/** * @return mixed|string|\yii\web\Response */ public function actionCreate() { $model = new User(['scenario' => 'newUser']); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['update', 'id' => $model->id]); } return $this->renderIsAjax('create', compact('model')); }