Exemplo n.º 1
0
 /**
  * Updates an existing AuthItem model.
  * If update is successful, the browser will be redirected to the 'view' page.
  * @param string $id
  * @return mixed
  */
 public function actionUpdate($id)
 {
     $model = $this->findModelChild($id);
     $searchModel = new AuthItemSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->name]);
     } else {
         return $this->render('index', ['model' => $model, 'searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
     }
 }
 /**
  * Lists all AuthItem models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new AuthItemSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }