@@ 122-126 (lines=5) @@ | ||
119 | } |
|
120 | } |
|
121 | } |
|
122 | if ($meta = Yii::$app->request->post('meta')) { |
|
123 | foreach ($meta as $name => $value) { |
|
124 | $model->setMeta($name, $value); |
|
125 | } |
|
126 | } |
|
127 | Yii::$app->getSession()->setFlash('success', |
|
128 | Yii::t('writesdown', '{type} successfully saved.', ['type' => $postType->singular_name, ])); |
|
129 | return $this->redirect(['update', 'id' => $model->id]); |
|
@@ 157-161 (lines=5) @@ | ||
154 | if ($model->load(Yii::$app->request->post())) { |
|
155 | $model->date = date('Y-m-d H:i:s', strtotime($model->date)); |
|
156 | if ($model->save()) { |
|
157 | if ($meta = Yii::$app->request->post('meta')) { |
|
158 | foreach ($meta as $name => $value) { |
|
159 | $model->setMeta($name, $value); |
|
160 | } |
|
161 | } |
|
162 | Yii::$app->getSession()->setFlash('success', |
|
163 | Yii::t('writesdown', '{type} successfully saved.', ['type' => $postType->singular_name, ])); |
|
164 | return $this->redirect(['post/update', 'id' => $id]); |