/** * Lists all Presentations models. * @return mixed */ public function actionIndex() { $service = (Yii::$app->request->get('PresentationsSearch') and isset(Yii::$app->request->get('PresentationsSearch')['service_id'])) ? $this->findService(Yii::$app->request->get('PresentationsSearch')['service_id']) : null; $this->layout = '/index_presentation'; $searchModel = new PresentationsSearch(); $searchModel->service = $service; $model_specs = $searchModel->loadPresentationObjectProperties($service, null); $model_methods = $searchModel->loadPresentationActionProperties($service); $location = Yii::$app->user->location ? Yii::$app->user->location : new Locations(); //print_r(Yii::$app->request->queryParams); die(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'service' => $service, 'model_specs' => $model_specs, 'model_methods' => $model_methods, 'location' => $location]); }
/** * Displays a single User model. * @param string $id * @return mixed */ public function actionPresentations($username = null) { $this->layout = '//user_list'; if (isset($username)) { $user = $this->findModelByUsername($username); if ($user) { $searchModel = new PresentationsSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('presentations', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'model' => $user]); } else { throw new NotFoundHttpException('The requested page does not exist.'); } } else { throw new NotFoundHttpException('The requested page does not exist.'); } }