controllers/PresetsController.php
public function actionUpdate($id)
    {
        $model = $this->findModel($id);
        $model->loadDefaultValues();
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            if(Yii::$app->request->post('action') === 'apply') {
                return $this->redirect(['update', 'id' => $model->id]);
            }else{
                return $this->redirect(['view', 'id' => $model->id]);
            }
        }

        return $this->render('update', [
            'model' => $model,
        ]);
    }
public function actionUpdate($id)
    {
        $model = $this->findModel($id);
        $model->loadDefaultValues();
        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            if(Yii::$app->request->post('action') === 'apply') {
                return $this->redirect(['update', 'id' => $model->id]);
            }else{
                return $this->redirect(['view', 'id' => $model->id]);
            }
        }

        return $this->render('update', [
            'model' => $model,
        ]);
    }
public function actionUpdate ( $ id ) { $ model = $ this -> findModel ( $ id ) ; $ model -> loadDefaultValues ( ) ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> save ( ) ) { if ( Yii :: $ app -> request -> post ( 'action' ) === 'apply' ) { return $ this -> redirect ( [ 'update' , 'id' => $ model -> id ] ) ; } else { return $ this -> redirect ( [ 'view' , 'id' => $ model -> id ] ) ; } } return $ this -> render ( 'update' , [ 'model' => $ model , ] ) ; }
Updates an existing SeoPresets model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed
@throws NotFoundHttpException if the model cannot be found
Updates an existing SeoPresets model . If update is successful the browser will be redirected to the view page .