/** * Updates an existing Curso 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->findModel($id); $searchModel = new DisciplinaSearch(); $searchModel->curso_idcurso = $id; // filtra a passagem para somente a viagem selecionada $dataProvider = $searchModel->search(Yii::$app->request->queryParams); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->idcurso]); } else { return $this->render('update', array('model' => $model, 'searchModel' => $searchModel, 'dataProvider' => $dataProvider)); } }
/** * Lists all Disciplina models. * @return mixed */ public function actionIndex() { $searchModel = new DisciplinaSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }