本文整理汇总了PHP中Task::unsetAttributes方法的典型用法代码示例。如果您正苦于以下问题:PHP Task::unsetAttributes方法的具体用法?PHP Task::unsetAttributes怎么用?PHP Task::unsetAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Task
的用法示例。
在下文中一共展示了Task::unsetAttributes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$model = new Task('search');
$model->unsetAttributes();
// clear any default values
if (isset($_GET['Task'])) {
$model->attributes = $_GET['Task'];
}
$this->render('admin', array('model' => $model));
}
示例2: actionView
/**
* Displays a particular model.
* @param integer $id the ID of the model to be displayed
*/
public function actionView($id)
{
if ($this->loadModel($id)->deleted == 1) {
throw new CHttpException(403, 'The page you are requested are invalid');
}
$tasks = new Task('search');
$tasks->unsetAttributes();
// clear any default values
$tasks->parent_id = $id;
if (isset($_GET['Task'])) {
$tasks->attributes = $_GET['Task'];
}
$this->render('view', array('model' => $this->loadModel($id), 'tasks' => $tasks));
}
示例3: actionAdmin
/**
* Manages all models.
*/
public function actionAdmin()
{
$this->pageTitle = get_class( Task::model() );
$model = new Task( 'search' );
$model->unsetAttributes(); // clear any default values
if ( isset( $_GET['Task'] ) )
$model->attributes = $_GET['Task'];
$this->render( 'admin', array(
'model' => $model,
) );
}
示例4: actionPeriod
public function actionPeriod($periodId)
{
$period = Period::model()->findByPk($periodId);
if ($period === NULL) {
throw new CHttpException(404, 'The requested page does not exist.');
}
if ($this->_user()->role == User::ROLE_USER) {
return $this->actionUser($periodId);
}
$model = new Task('search');
$model->unsetAttributes();
// clear any default values
$model->period_id = $periodId;
if (isset($_GET['Task'])) {
$model->attributes = $_GET['Task'];
}
$this->render('period', array('model' => $model, 'period' => $period));
}