/** * Lists all Image models. * @return mixed */ public function actionIndex() { $get = Yii::$app->request->get(); $slider = Slider::findOne($get['sliderId']); $searchModel = new ImageSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $slider->id, Slider::className()); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'slider' => $slider]); }
/** * Lists all Image models. * @return mixed */ public function actionIndex() { // An option-set id is provided through the url so store it in a session variable if (Yii::$app->request->get('sliderId')) { Yii::$app->session->set('slider.sliderId', Yii::$app->request->get('sliderId')); } $get = Yii::$app->request->get(); $slider = Slider::findOne($get['sliderId']); $searchModel = new ImageSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $slider->id, Slider::className()); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'slider' => $slider]); }
/** * Lists all Image models. * @return mixed */ public function actionIndex() { // An option-set id is provided through the url so store it in a session variable if (Yii::$app->request->get('gallery-id')) { Yii::$app->session->set('gallery.gallery-id', Yii::$app->request->get('gallery-id')); } // Check for a valid option-set id, otherwise redirect back to the option sets if (Yii::$app->session->get('gallery.gallery-id', null) === null) { return $this->redirect(Url::to(['gallery/index'])); } $gallery = Gallery::findOne(Yii::$app->session->get('gallery.gallery-id')); $searchModel = new ImageSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $gallery->id, Gallery::className()); return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider, 'gallery' => $gallery]); }