本文整理汇总了PHP中Blog::unsetAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP Blog::unsetAttributes方法的具体用法?PHP Blog::unsetAttributes怎么用?PHP Blog::unsetAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blog
的用法示例。
在下文中一共展示了Blog::unsetAttributes方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
/**
* Выводит список блогов
*
* @return void
*/
public function actionIndex()
{
$blogs = new Blog('search');
$blogs->unsetAttributes();
$blogs->status = Blog::STATUS_ACTIVE;
if (isset($_GET['Blog']['name'])) {
$blogs->name = CHtml::encode($_GET['Blog']['name']);
}
$this->render('index', ['blogs' => $blogs]);
}
示例2: actionIndex
/**
* Выводит список блогов
*
* @return void
*/
public function actionIndex()
{
$blogs = new Blog('search');
$blogs->unsetAttributes();
$blogs->status = Blog::STATUS_ACTIVE;
$blogs->type = (int) Yii::app()->request->getQuery('type', Blog::TYPE_PUBLIC);
if (isset($_GET['Blog']['name'])) {
$blogs->name = CHtml::encode($_GET['Blog']['name']);
}
$this->render('index', array('blogs' => $blogs));
}
示例3: actionIndex
/**
* Управление блогами.
*
* @return nothing
**/
public function actionIndex()
{
$model = new Blog('search');
$model->unsetAttributes();
// clear any default values
if (Yii::app()->getRequest()->getParam('Blog') !== null) {
$model->setAttributes(Yii::app()->getRequest()->getParam('Blog'));
}
$this->render('index', array('model' => $model));
}
示例4: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new Blog('search');
$catelist = array();
$catelist[0] = '全部';
$catelist = $catelist + Category::getDropList(1);
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Blog'])) {
$model->attributes = $_GET['Blog'];
}
if ($model->pid == 0) {
$model->pid = '';
}
$this->render('admin', array('model' => $model, 'catelist' => $catelist));
}
示例5: actionIndex
/**
* Управление блогами.
*
* @return nothing
**/
public function actionIndex()
{
$model = new Blog('search');
$model->unsetAttributes();
if (Yii::app()->getRequest()->getParam('Blog') !== null) {
$model->setAttributes(Yii::app()->getRequest()->getParam('Blog'));
}
$this->render('index', ['model' => $model]);
}
示例6: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new Blog('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Blog'])) {
$model->attributes = $_GET['Blog'];
}
$this->render('admin', array('model' => $model));
}