| @@ 103-112 (lines=10) @@ | ||
| 100 | } |
|
| 101 | $model->flow_id = $flow->id; |
|
| 102 | ||
| 103 | if ($model->load(Yii::$app->request->post()) && $model->save()) { |
|
| 104 | return $this->redirect(['view', 'id' => $model->id]); |
|
| 105 | } else { |
|
| 106 | $model->loadDefaultValues(); |
|
| 107 | ||
| 108 | return $this->render('create', [ |
|
| 109 | 'model' => $model, |
|
| 110 | 'contentTypes' => ContentType::getAllList(false), |
|
| 111 | ]); |
|
| 112 | } |
|
| 113 | } |
|
| 114 | ||
| 115 | /** |
|
| @@ 241-248 (lines=8) @@ | ||
| 238 | { |
|
| 239 | $model = $this->findViewableModel($id, Yii::$app->user); |
|
| 240 | ||
| 241 | if ($model->load(Yii::$app->request->post()) && $model->save()) { |
|
| 242 | return $this->redirect(['view', 'id' => $model->id]); |
|
| 243 | } else { |
|
| 244 | return $this->render('update', [ |
|
| 245 | 'model' => $model, |
|
| 246 | 'contentTypes' => ContentType::getAllList(false, true), |
|
| 247 | ]); |
|
| 248 | } |
|
| 249 | } |
|
| 250 | ||
| 251 | /** |
|