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