controllers/TemplateController.php
/**
     * Updates an existing MailTemplate model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param string $alias
     * @return mixed
     * @throws NotFoundHttpException if the model cannot be found
     */
Updates an existing MailTemplate model.
If update is successful, the browser will be redirected to the 'view' page.
@param string $alias
@return mixed
@throws NotFoundHttpException if the model cannot be found
Updates an existing MailTemplate model . If update is successful the browser will be redirected to the ' view ' page . @param string $alias @return mixed @throws NotFoundHttpException if the model cannot be found
public function actionUpdate($alias)
    {
        $model = $this->findModel($alias);
        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('update', [
            'model' => $model,
        ]);
    }
public function actionUpdate ( $ alias ) { $ model = $ this -> findModel ( $ alias ) ; 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 ( 'update' , [ 'model' => $ model , ] ) ; }
Updates an existing MailTemplate model.
Updates an existing MailTemplate model .
/** @noinspection MissedViewInspection */