Commit 0b7a7340 authored by Shakarim Sapa's avatar Shakarim Sapa

- Внесены изменения в action Update

parent 0907836a
......@@ -74,7 +74,7 @@ class TemplateAdminController extends AdminController {
*/
public function actionUpdate($id){
/** @var MessageTemplate $model */
$model = $this->loadModel($id);
$model = MessageTemplate::findOne($id);
if ($model->load(Yii::$app->request->post())) {
if ($model->save())
......@@ -83,16 +83,15 @@ class TemplateAdminController extends AdminController {
'manage'
]
);
} else {
$form = new \common\components\BaseForm('/common/modules/messageTemplate/forms/TemplateForm', $model);
return $this->render(
'update',
[
'model' => $model,
'form' => $form
]
);
}
$form = new \common\components\BaseForm('/common/modules/messageTemplate/forms/TemplateForm', $model);
return $this->render(
'update',
[
'model' => $model,
'form' => $form
]
);
}
/**
......@@ -108,7 +107,7 @@ class TemplateAdminController extends AdminController {
/**
* @param $id
* @return null|MessageTemplate
* @throws NotFoundHttpException
* @throws \yii\web\NotFoundHttpException
*/
protected function findModel($id)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment