public function actionAdmin() { $model = new Producer('search'); $model->unsetAttributes(); if (isset($_GET['Producer'])) { $model->setAttributes($_GET['Producer']); } $this->render('admin', array('model' => $model)); }
/** * */ public function actionCreate() { $model = new Producer(); $data = Yii::app()->getRequest()->getPost('Producer'); if (!is_null($data)) { $model->setAttributes($data); if ($model->save()) { Yii::app()->user->setFlash(yupe\widgets\YFlashMessages::SUCCESS_MESSAGE, Yii::t('StoreModule.store', 'Record was created!')); $this->redirect((array) Yii::app()->getRequest()->getPost('submit-type', ['create'])); } } $this->render('create', ['model' => $model]); }