コード例 #1
0
ファイル: DefaultController.php プロジェクト: promo-pr/cms
 /**
  * Creates a new Page model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $this->layout = '@app/views/layouts/admin';
     $model = new Page();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['/page/node/view', 'slug' => $model->slug]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }