public function actionCreate()
    {
        $model = Yii::createObject($this->modelClass);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->session->setFlash('success', Yii::t('yii2mod.cms', 'Page has been created.'));

            return $this->redirect(['index']);
        }

        return $this->render($this->createView, [
            'model' => $model,
        ]);
    }
public function actionCreate()
    {
        $model = Yii::createObject($this->modelClass);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->session->setFlash('success', Yii::t('yii2mod.cms', 'Page has been created.'));

            return $this->redirect(['index']);
        }

        return $this->render($this->createView, [
            'model' => $model,
        ]);
    }
public function actionCreate ( ) { $ model = Yii :: createObject ( $ this -> modelClass ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> save ( ) ) { Yii :: $ app -> session -> setFlash ( 'success' , Yii :: t ( 'yii2mod.cms' , 'Page has been created.' ) ) ; return $ this -> redirect ( [ 'index' ] ) ; } return $ this -> render ( $ this -> createView , [ 'model' => $ model , ] ) ; }
Creates a new CmsModel.

If creation is successful, the browser will be redirected to the 'index' page.

@return mixed
Creates a new CmsModel .