/** * Creates a new BActions model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { if (Yii::$app->user->isGuest) { $this->redirect(Yii::$app->user->loginUrl); } $model = new BActions(); if ($model->load(Yii::$app->request->post())) { $model->date = time(); $model->save(); //print_r($model->getErrors()); return $this->redirect(['/admin/actions']); } else { return $this->render('create', ['model' => $model]); } }