protected function commonAction($model, $redirectUrl, $view)
    {
        $request = Yii::$app->getRequest();

        if ($request->getIsPost() && $this->repository->save($model, $request->post())) {
            return $this->redirect($redirectUrl);
        }

        return $this->render($view, \compact('model'));
    }
protected function commonAction($model, $redirectUrl, $view)
    {
        $request = Yii::$app->getRequest();

        if ($request->getIsPost() && $this->repository->save($model, $request->post())) {
            return $this->redirect($redirectUrl);
        }

        return $this->render($view, \compact('model'));
    }
protected function commonAction ( $ model , $ redirectUrl , $ view ) { $ request = Yii :: $ app -> getRequest ( ) ; if ( $ request -> getIsPost ( ) && $ this -> repository -> save ( $ model , $ request -> post ( ) ) ) { return $ this -> redirect ( $ redirectUrl ) ; } return $ this -> render ( $ view , \ compact ( 'model' ) ) ; }
Common code for create and update actions.

@param mixed $model
@param array $redirectUrl
@param string $view

@return string|\yii\web\Response
Common code for create and update actions .