Example #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Paginas::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id_pag' => $this->id_pag, 'meta_id' => $this->meta_id, 'imagen_id' => $this->imagen_id, 'autor_id' => $this->autor_id, 'creado' => $this->creado, 'actualizado' => $this->actualizado]);
     $query->andFilterWhere(['like', 'titulo', $this->titulo])->andFilterWhere(['like', 'contenido', $this->contenido])->andFilterWhere(['like', 'estado', $this->estado])->andFilterWhere(['like', 'slug', $this->slug])->andFilterWhere(['like', 'meta_keywords', $this->meta_keywords])->andFilterWhere(['like', 'meta_description', $this->meta_description])->andFilterWhere(['like', 'meta_code_css', $this->meta_code_css])->andFilterWhere(['like', 'meta_code_js', $this->meta_code_js]);
     return $dataProvider;
 }
Example #2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Paginas::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['idpagina' => $this->idpagina, 'categoria' => $this->categoria, 'padre' => $this->padre, 'plantilla' => $this->plantilla, 'autor' => $this->autor, 'fechacreado' => $this->fechacreado, 'fechaactualizado' => $this->fechaactualizado]);
     $query->andFilterWhere(['like', 'titulo', $this->titulo])->andFilterWhere(['like', 'contenido', $this->contenido])->andFilterWhere(['like', 'leermas', $this->leermas])->andFilterWhere(['like', 'slug', $this->slug])->andFilterWhere(['like', 'estado', $this->estado])->andFilterWhere(['like', 'tipo', $this->tipo])->andFilterWhere(['like', 'meta_titulo', $this->meta_titulo])->andFilterWhere(['like', 'meta_palabras', $this->meta_palabras])->andFilterWhere(['like', 'meta_descripcion', $this->meta_descripcion]);
     return $dataProvider;
 }