public function actionCreate()
    {

        if (\Yii::$app->user->can('create')) {
            $model = new Author();

            if ($model->load(\Yii::$app->request->post()) && $model->save()) {
                return $this->redirect(['index']);
            } else {
                return $this->render('create', [
                    'model' => $model,
                ]);
            }
        } else
            throw new ForbiddenHttpException(Module::t('core', 'Access denied.'));
    }
public function actionCreate()
    {

        if (\Yii::$app->user->can('create')) {
            $model = new Author();

            if ($model->load(\Yii::$app->request->post()) && $model->save()) {
                return $this->redirect(['index']);
            } else {
                return $this->render('create', [
                    'model' => $model,
                ]);
            }
        } else
            throw new ForbiddenHttpException(Module::t('core', 'Access denied.'));
    }
public function actionCreate ( ) { if ( \ Yii :: $ app -> user -> can ( 'create' ) ) { $ model = new Author ( ) ; if ( $ model -> load ( \ Yii :: $ app -> request -> post ( ) ) && $ model -> save ( ) ) { return $ this -> redirect ( [ 'index' ] ) ; } else { return $ this -> render ( 'create' , [ 'model' => $ model , ] ) ; } } else throw new ForbiddenHttpException ( Module :: t ( 'core' , 'Access denied.' ) ) ; }
Creates a new Author model.
If creation is successful, the browser will be redirected to the 'index' page.
@return mixed
Creates a new Author model . If creation is successful the browser will be redirected to the index page .