| @@ 92-103 (lines=12) @@ | ||
| 89 | * |
|
| 90 | * @return mixed |
|
| 91 | */ |
|
| 92 | public function actionCreate() |
|
| 93 | { |
|
| 94 | $model = new Option(); |
|
| 95 | ||
| 96 | if ($model->load(Yii::$app->request->post()) && $model->save()) { |
|
| 97 | return $this->redirect(['view', 'id' => $model->id]); |
|
| 98 | } |
|
| 99 | ||
| 100 | return $this->render('create', [ |
|
| 101 | 'model' => $model, |
|
| 102 | ]); |
|
| 103 | } |
|
| 104 | ||
| 105 | /** |
|
| 106 | * Updates an existing Option model. |
|
| @@ 112-123 (lines=12) @@ | ||
| 109 | * @param integer $id |
|
| 110 | * @return mixed |
|
| 111 | */ |
|
| 112 | public function actionUpdate($id) |
|
| 113 | { |
|
| 114 | $model = $this->findModel($id); |
|
| 115 | ||
| 116 | if ($model->load(Yii::$app->request->post()) && $model->save()) { |
|
| 117 | return $this->redirect(['view', 'id' => $model->id]); |
|
| 118 | } |
|
| 119 | ||
| 120 | return $this->render('update', [ |
|
| 121 | 'model' => $model, |
|
| 122 | ]); |
|
| 123 | } |
|
| 124 | ||
| 125 | /** |
|
| 126 | * Deletes an existing Option model. |
|
| @@ 113-124 (lines=12) @@ | ||
| 110 | * |
|
| 111 | * @return mixed |
|
| 112 | */ |
|
| 113 | public function actionCreate() |
|
| 114 | { |
|
| 115 | $model = new Taxonomy(); |
|
| 116 | ||
| 117 | if ($model->load(Yii::$app->request->post()) && $model->save()) { |
|
| 118 | return $this->redirect(['view', 'id' => $model->id]); |
|
| 119 | } |
|
| 120 | ||
| 121 | return $this->render('create', [ |
|
| 122 | 'model' => $model, |
|
| 123 | ]); |
|
| 124 | } |
|
| 125 | ||
| 126 | /** |
|
| 127 | * Updates an existing Taxonomy model. |
|
| @@ 133-144 (lines=12) @@ | ||
| 130 | * @param integer $id |
|
| 131 | * @return mixed |
|
| 132 | */ |
|
| 133 | public function actionUpdate($id) |
|
| 134 | { |
|
| 135 | $model = $this->findModel($id); |
|
| 136 | ||
| 137 | if ($model->load(Yii::$app->request->post()) && $model->save()) { |
|
| 138 | return $this->redirect(['view', 'id' => $model->id]); |
|
| 139 | } |
|
| 140 | ||
| 141 | return $this->render('update', [ |
|
| 142 | 'model' => $model, |
|
| 143 | ]); |
|
| 144 | } |
|
| 145 | ||
| 146 | /** |
|
| 147 | * Deletes an existing Taxonomy model. |
|
| @@ 204-215 (lines=12) @@ | ||
| 201 | * @return string|\yii\web\Response |
|
| 202 | * @throws \yii\web\NotFoundHttpException |
|
| 203 | */ |
|
| 204 | public function actionProfile() |
|
| 205 | { |
|
| 206 | $model = $this->findModel(Yii::$app->user->id); |
|
| 207 | ||
| 208 | if ($model->load(Yii::$app->request->post()) && $model->save()) { |
|
| 209 | return $this->redirect(['view', 'id' => $model->id]); |
|
| 210 | } |
|
| 211 | ||
| 212 | return $this->render('profile', [ |
|
| 213 | 'model' => $model, |
|
| 214 | ]); |
|
| 215 | } |
|
| 216 | ||
| 217 | /** |
|
| 218 | * Reset password for logged user. |
|