/** * Manages all models. */ public function actionAdmin() { $model = new Section('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Section'])) { $model->attributes = $_GET['Section']; } $this->render('admin', array('model' => $model)); }
/** * Manages all models. */ public function actionAdmin($id_tree) { if (!Tree::model()->exists('id=:id', array(':id' => $id_tree))) { throw new CHttpException(400, "Неверный запрос. Раздел с ИД {$id_tree} не найден!"); } if (!CheckAcccess::checkAccessNode($id_tree)) { throw new CHttpException(403, "У вас недостаточно прав для выполнения указанного действия."); } $model = new Section('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Section'])) { $model->attributes = $_GET['Section']; } $this->render('admin', array('model' => $model)); }