コード例 #1
0
ファイル: StaticController.php プロジェクト: ewwgit/eptri
 /**
  * Creates a new StaticPages model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new StaticPages();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->staticId]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }
コード例 #2
0
ファイル: StaticController.php プロジェクト: ewwgit/eptri
 /**
  * Creates a new Staticpages model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new StaticPages();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         Yii::$app->session->setFlash('success', "Statice Page successfully Created");
         return $this->redirect(['index', 'id' => $model->staticId]);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }