/** * Manages all models. */ public function actionAdmin() { if (isset($_POST['del'])) { $model = Quests::model()->deleteByPk($_POST['id']); } $model = new Quests('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Quests'])) { $model->attributes = $_GET['Quests']; } $this->render('admin', array('model' => $model)); }