controllers/TemplateController.php
/**
     * Creates a new MailTemplate model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
Creates a new MailTemplate model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
Creates a new MailTemplate model . If creation is successful the browser will be redirected to the ' view ' page . @return mixed
public function actionCreate()
    {
        $model = new MailTemplate();
        $model->loadDefaultValues();
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            Yii::$app->session->setFlash('success', Yii::t('mail', '{NAME} saved', [
                'NAME' => $model->name,
            ]));
            if (Yii::$app->request->post('action') === 'apply') {
                return $this->redirect(['update', 'alias' => $model->alias]);
            }
            return $this->redirect(['index']);
        }
        return $this->render('create', [
            'model' => $model,
        ]);
    }
public function actionCreate ( ) { $ model = new MailTemplate ( ) ; $ model -> loadDefaultValues ( ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> save ( ) ) { Yii :: $ app -> session -> setFlash ( 'success' , Yii :: t ( 'mail' , '{NAME} saved' , [ 'NAME' => $ model -> name , ] ) ) ; if ( Yii :: $ app -> request -> post ( 'action' ) === 'apply' ) { return $ this -> redirect ( [ 'update' , 'alias' => $ model -> alias ] ) ; } return $ this -> redirect ( [ 'index' ] ) ; } return $ this -> render ( 'create' , [ 'model' => $ model , ] ) ; }
Creates a new MailTemplate model.
Creates a new MailTemplate model .
/** @noinspection MissedViewInspection */