/** * Manages all models. */ public function actionIndex() { $model = new Work('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Work'])) { $model->attributes = $_GET['Work']; } $this->render('index', array('model' => $model)); }
/** * Manages all models. */ public function actionAdmin() { $model = new Work('search'); $model->unsetAttributes(); // clear any default values $model->serviceType = new ServiceType('search'); $model->serviceType->unsetAttributes(); if (isset($_GET['Work'])) { $model->attributes = $_GET['Work']; } if (isset($_GET['ServiceType'])) { $model->serviceType->attributes = $_GET['ServiceType']; } if (isset($_GET['pageSize'])) { Yii::app()->user->setState('pageSize', (int) $_GET['pageSize']); unset($_GET['pageSize']); // would interfere with pager and repetitive page size change } $this->render('admin', array('model' => $model)); }