public function actionCreate() { $model = new Pages(); if ($model->load(Yii::$app->request->post())) { if ($model->save()) { Yii::$app->getSession()->setFlash('success', 'Страница успешно добавлена.'); return $this->redirect(['index']); } } return $this->render('create', ['model' => $model]); }