public function actionInvite() { $model = new Invite(); if (Yii::app()->request->isPostRequest) { $params = Yii::app()->request->getParam('Invite'); $model->setAttributes($params); $model->setAttribute('index.twigstatus', 0); if ($model->save()) { Yii::app()->user->setFlash('success', 'Ваше заявка отправлена, спасибо!'); $model->unsetAttributes(); } } $this->render('invite', ['model' => $model]); }
/** * Manages all models. */ public function actionAdmin() { $model = new Invite('search'); $model->unsetAttributes(); // clear any default values if (isset($_GET['Invite'])) { $model->attributes = $_GET['Invite']; } $this->render('admin', array('model' => $model)); }