Esempio n. 1
0
 /**
  * Updates an existing Role model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param string $id
  * @return mixed
  */
 public function actionUpdate($id)
 {
     $authManager = Yii::$app->getAuthManager();
     $role = $authManager->getRole($id);
     $model = Kiwi::getRoleModel(['role' => $role]);
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['index']);
     }
     return $this->render('/role/update', ['model' => $model]);
 }