本文整理汇总了PHP中Y::dump方法的典型用法代码示例。如果您正苦于以下问题:PHP Y::dump方法的具体用法?PHP Y::dump怎么用?PHP Y::dump使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Y
的用法示例。
在下文中一共展示了Y::dump方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListView
public function getListView(&$criteria, $return = false)
{
$dp = new EActiveDataProvider(get_class($this->model), array(
'criteria' => $criteria,
//'pagination' => $this->settings['pagination'],
));
//default params
$params = array(
'dataProvider'=>$dp,
'pager'=>array(
'id'=>$this->widgetModel->pk.'Pager', 'class'=>'LinkPager', 'htmlOptions'=>array('class'=>'pager'),
'cssFile'=>Yii::app()->baseUrl.'/css/pager.css'
),
'ajaxUpdate'=>true,
'template'=>$this->render('listTemplate', array(), true),
'afterAjaxUpdate' => ModelFactory::getAfterAjaxUpdateFunction($this->category->type),
'beforeAjaxUpdate' => ModelFactory::getBeforeAjaxUpdateFunction($this->category->type),
'category' => $this->category,
'contextWidget' => $this
);
try {
$res = Y::controller()->widget('ListView', $params, true);
} catch (CException $e) {
Y::dump($e->__toString());
}
if ($return)
return $res;
else
echo $res;
}
示例2: __toString
public function __toString() //__toString can't throw Exception in PHP
{
try {
return $this->renderBlock($this->templateAlias);
} catch (CException $e) {
Y::dump($e->__toString());
}
}
示例3: setPositions
public function setPositions($ids, $table, $criteria = null)
{
$criteria = $criteria ? $criteria : new CDbCriteria();
$owner = $this->getOwner();
$pk = $owner->primaryKey();
//last id have 0 priority => revers => first id have 0 priority => flip => every id have their priority
$priorities = array_flip(array_reverse($ids));
$data = array('priority' => Sql::arrToCase($pk, $priorities));
$c = Yii::app()->db->commandBuilder->createUpdateCommand($table, $data, $criteria);
Y::dump($c->execute());
}
示例4: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$all = Lookup::model()->getAll();
Y::dump($all);
$model = new Portfolio('search');
$model->unsetAttributes(); // clear any default values
$model = $model->current($cat);
if (isset($_GET['Portfolio']))
$model->attributes=$_GET['Portfolio'];
if (isset($_GET['ajax'])) {
$this->renderPartial('admingrid',array(
'model'=>$model,
));
} else {
$this->render('admin',array(
'model'=>$model,
'cat'=>$cat
));
}
}
示例5: actionBisec
public function actionBisec()
{
$c = Yii::app()->db->getCommandBuilder()->createFindCommand('edge', new CDbCriteria(array('condition' => 't.edge="associate"')));
$data = $c->limit(1000)->query();
$n = Node::model()->count();
$tmp = array_fill(0, $n, 10000);
$W = array_fill(0, $n, $tmp);
$k = 0;
foreach ($data as $item) {
$i = (int) $item['source'];
$j = (int) $item['target'];
$W[$i][$j] = $W[$j][$i] = 1;
if (++$k > 100) {
break;
}
}
Y::end(round(memory_get_peak_usage() / (1024 * 1024), 2) . "MB");
$f = Yii::getPathOfAlias('application') . '/../gr.txt';
Y::dump(file_put_contents($f, json_encode($W)));
// Initialization
for ($i = 0; $i < $n; $i++) {
$W[$i][$i] = INF;
}
$f = Yii::getPathOfAlias('application') . '/../gr.txt';
Y::dump(file_put_contents($f, json_encode($W)));
// Algorithm
for ($k = 0; $k < $n; $k++) {
for ($i = 0; $i < $n; $i++) {
for ($j = 0; $j < $n; $j++) {
$W[$i][$j] = min($W[$i][$j], $W[$i][$k] + $W[$k][$j]);
}
}
if ($k == 10) {
break;
}
}
Y::end($W);
}
示例6: actionSaveWidgetsPosition
public function actionSaveWidgetsPosition($blockPk, $widgets)
{
Y::dump($widgets);
}
示例7: handlerUpdate
public function handlerUpdate($event)
{
Y::dump($this->getViewPath());
}