| @@ 86-98 (lines=13) @@ | ||
| 83 | * |
|
| 84 | * @return \yii\web\Response|string redirect or render |
|
| 85 | */ |
|
| 86 | public function actionCreate() |
|
| 87 | { |
|
| 88 | $model = new ScreenTemplate(); |
|
| 89 | ||
| 90 | if ($model->load(Yii::$app->request->post()) && $model->save()) { |
|
| 91 | return $this->redirect(['view', 'id' => $model->id]); |
|
| 92 | } |
|
| 93 | ||
| 94 | return $this->render('create', [ |
|
| 95 | 'model' => $model, |
|
| 96 | 'backgrounds' => self::backgroundsArray(), |
|
| 97 | ]); |
|
| 98 | } |
|
| 99 | ||
| 100 | /** |
|
| 101 | * Updates an existing ScreenTemplate model. |
|
| @@ 108-120 (lines=13) @@ | ||
| 105 | * |
|
| 106 | * @return \yii\web\Response|string redirect or render |
|
| 107 | */ |
|
| 108 | public function actionUpdate($id) |
|
| 109 | { |
|
| 110 | $model = $this->findModel($id); |
|
| 111 | ||
| 112 | if ($model->load(Yii::$app->request->post()) && $model->save()) { |
|
| 113 | return $this->redirect(['view', 'id' => $model->id]); |
|
| 114 | } |
|
| 115 | ||
| 116 | return $this->render('update', [ |
|
| 117 | 'model' => $model, |
|
| 118 | 'backgrounds' => self::backgroundsArray(), |
|
| 119 | ]); |
|
| 120 | } |
|
| 121 | ||
| 122 | /** |
|
| 123 | * Deletes an existing ScreenTemplate model. |
|
| @@ 86-97 (lines=12) @@ | ||
| 83 | * |
|
| 84 | * @return \yii\web\Response|string redirect or render |
|
| 85 | */ |
|
| 86 | public function actionUpdate($id) |
|
| 87 | { |
|
| 88 | $model = $this->findModel($id); |
|
| 89 | ||
| 90 | if ($model->load(Yii::$app->request->post()) && $model->save()) { |
|
| 91 | return $this->redirect(['view', 'id' => $model->id]); |
|
| 92 | } else { |
|
| 93 | return $this->render('update', [ |
|
| 94 | 'model' => $model, |
|
| 95 | ]); |
|
| 96 | } |
|
| 97 | } |
|
| 98 | ||
| 99 | /** |
|
| 100 | * Deletes an existing Device model. |
|