public function actionCreate()
    {
        $model = $this->module->manager->createBlock(['scenario' => 'create']);

        if ($model->load(\Yii::$app->request->post()) && $model->create()) {
            \Yii::$app->getSession()->setFlash('block.success', \Yii::t('block', 'Block has been created'));
            return $this->redirect(['index']);
        }

        return $this->render('create', [
            'model' => $model
        ]);
    }
public function actionCreate()
    {
        $model = $this->module->manager->createBlock(['scenario' => 'create']);

        if ($model->load(\Yii::$app->request->post()) && $model->create()) {
            \Yii::$app->getSession()->setFlash('block.success', \Yii::t('block', 'Block has been created'));
            return $this->redirect(['index']);
        }

        return $this->render('create', [
            'model' => $model
        ]);
    }
public function actionCreate ( ) { $ model = $ this -> module -> manager -> createBlock ( [ 'scenario' => 'create' ] ) ; if ( $ model -> load ( \ Yii :: $ app -> request -> post ( ) ) && $ model -> create ( ) ) { \ Yii :: $ app -> getSession ( ) -> setFlash ( 'block.success' , \ Yii :: t ( 'block' , 'Block has been created' ) ) ; return $ this -> redirect ( [ 'index' ] ) ; } return $ this -> render ( 'create' , [ 'model' => $ model ] ) ; }
Creates a new Block model.
If creation is successful, the browser will be redirected to the 'index' page.
@return mixed
Creates a new Block model . If creation is successful the browser will be redirected to the index page .