/** * */ public function actionIndex() { $model = new Callback('search'); $model->unsetAttributes(); if ($data = Yii::app()->getRequest()->getQuery('Callback')) { $model->setAttributes($data); } $this->render('index', ['model' => $model]); }
/** * Add callback request to DB * * @param $data * @return bool */ public function add($data) { if (!$data) { return false; } $model = new Callback(); $model->setAttributes($data); if ($model->save()) { $this->sendNotification($model); return true; } return false; }