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