From ae2e9ad024c9020e31fee51b7eb889cdd0fdfd80 Mon Sep 17 00:00:00 2001 From: vova Date: Fri, 13 May 2022 17:36:13 +0300 Subject: [PATCH] tile fix --- backend/controllers/TileController.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+), 0 deletions(-) diff --git a/backend/controllers/TileController.php b/backend/controllers/TileController.php index 59a79cb..34562af 100644 --- a/backend/controllers/TileController.php +++ b/backend/controllers/TileController.php @@ -11,6 +11,34 @@ use yii\web\NotFoundHttpException; class TileController extends Controller { /** + * Updates an existing Tile model. + * If update is successful, the browser will be redirected to the 'view' page. + * @param integer $id + * @return mixed + */ + public function actionUpdate($id) + { + $model = $this->findModel($id); + $model->generateLangs(); + + if ($model->loadWithLangs(\Yii::$app->request)) { + + if ($model->saveWithLangs()) { + + return $this->redirect( + [ + 'view', + 'id' => $model->id, + ] + ); + } + } + return $this->render('update', [ + 'model' => $model, + 'modelLangs' => $model->modelLangs, + ]); + } + /** * Lists all Tile models. * @return mixed */ -- libgit2 0.21.4