@@ 82-89 (lines=8) @@ | ||
79 | ||
80 | $successMessage = $this->getSuccessMessage($isNewRecord); |
|
81 | $this->setFlash($successMessage); |
|
82 | if ($this->actionParams->isAjax && !$this->actionParams->isPjax) { |
|
83 | return $this->getResponse([ |
|
84 | 'format' => \yii\web\Response::FORMAT_JSON, |
|
85 | 'content' => [ |
|
86 | 'message' => $this->getSuccessMessage($isNewRecord), |
|
87 | ], |
|
88 | ]); |
|
89 | } |
|
90 | ||
91 | $result = $this->redirectAfterSave(); |
|
92 | if ($result === false) { |
|
@@ 99-106 (lines=8) @@ | ||
96 | ]; |
|
97 | } |
|
98 | } else { |
|
99 | if ($this->actionParams->isAjax && !$this->actionParams->isPjax) { |
|
100 | return $this->getResponse([ |
|
101 | 'format' => \yii\web\Response::FORMAT_JSON, |
|
102 | 'content' => [ |
|
103 | 'success' => true, |
|
104 | ], |
|
105 | ]); |
|
106 | } |
|
107 | ||
108 | if (!empty($model->errors)) { |
|
109 | $flash = Html::errorSummary($model, [ |