/** * Lists all models. */ public function actionIndex() { parent::actionIndex(); $prmaterial = new Prmaterial('search'); $prmaterial->unsetAttributes(); // clear any default values if (isset($_GET['Prmaterial'])) { $prmaterial->attributes = $_GET['Prmaterial']; } $model = new Prheader('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Prheader'])) { $model->attributes = $_GET['Prheader']; } 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('index', array('model' => $model, 'prmaterial' => $prmaterial)); }
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer the ID of the model to be loaded */ public function loadModel($id) { $model = Prheader::model()->findByPk((int) $id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }