public function search($params) { $query = SliderImage::find(); $dataProvider = new ActiveDataProvider(['query' => $query]); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere(['id' => $this->id, 'publish_flag' => $this->publish_flag, 'slider' => $this->slider, 'created_date' => $this->created_date]); $query->andFilterWhere(['like', 'href', $this->href])->andFilterWhere(['like', 'body', $this->body])->andFilterWhere(['like', 'banner_image', $this->banner_image])->andFilterWhere(['like', 'banner_phone_image', $this->banner_phone_image])->andFilterWhere(['like', 'banner_tablet_image', $this->banner_tablet_image])->andFilterWhere(['like', 'menu_image', $this->menu_image])->andFilterWhere(['like', 'href_enabled_flag', $this->href_enabled_flag])->andFilterWhere(['like', 'iframe_href', $this->iframe_href]); return $dataProvider; }
/** * Finds the SliderImage model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return SliderImage the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = SliderImage::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }