/** * Displays a particular model. * @param integer $id the ID of the model to be displayed */ public function actionView($id) { //find the user $this->layout = '//layouts/user'; $user = User::model()->findByPk($id); if ($user == null) { throw new CHttpException(404, 'The specified user cannot be found.'); } $this->user = $user; //find the illust $model = new Illust('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Illust'])) { $model->attributes = $_GET['Illust']; } $this->render('view', array('model' => $model, 'user' => $user)); }
public function actionBookmark() { $user = User::model()->findByPk(Yii::app()->user->id); if ($user == null) { throw new CHttpException(404, 'The specified user cannot be found.'); } $model = new Illust('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Illust'])) { $model->attributes = $_GET['Illust']; } $this->render('bookmark', array('model' => $model, 'user' => $user)); }
/** * Manages all models. */ public function actionAdmin() { $this->layout = '//layouts/admin'; $model = new Illust('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Illust'])) { $model->attributes = $_GET['Illust']; } $this->render('admin', array('model' => $model)); }