backend/models/search/MailTemplatesSearch.php
/**
     * Creates data provider instance with search query applied
     *
     * @param array $params
     *
     * @return ActiveDataProvider
     */
Creates data provider instance with search query applied
@param array $params


Creates data provider instance with search query applied @param array $params
public function search($params)
    {
        $query = MailTemplates::find();
        $dataProvider = new ActiveDataProvider([
            'query' => $query,
            'pagination' => false,
        ]);
        $this->load($params);
        if (!$this->validate()) {
            return $dataProvider;
        }
        $query->andFilterWhere([
            'template_id' => $this->template_id,
        ]);
        $query->andFilterWhere(['like', 'template_key', $this->template_key])
            ->andFilterWhere(['like', 'template_lang', $this->template_lang])
            ->andFilterWhere(['like', 'template_from_email', $this->template_from_email])
            ->andFilterWhere(['like', 'template_from_name', $this->template_from_name])
            ->andFilterWhere(['like', 'template_subject', $this->template_subject])
            ->andFilterWhere(['like', 'template_body_html', $this->template_body_html])
            ->andFilterWhere(['like', 'template_body_text', $this->template_body_text]);
        return $dataProvider;
    }
public function search ( $ params ) { $ query = MailTemplates :: find ( ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , 'pagination' => false , ] ) ; $ this -> load ( $ params ) ; if ( ! $ this -> validate ( ) ) { return $ dataProvider ; } $ query -> andFilterWhere ( [ 'template_id' => $ this -> template_id , ] ) ; $ query -> andFilterWhere ( [ 'like' , 'template_key' , $ this -> template_key ] ) -> andFilterWhere ( [ 'like' , 'template_lang' , $ this -> template_lang ] ) -> andFilterWhere ( [ 'like' , 'template_from_email' , $ this -> template_from_email ] ) -> andFilterWhere ( [ 'like' , 'template_from_name' , $ this -> template_from_name ] ) -> andFilterWhere ( [ 'like' , 'template_subject' , $ this -> template_subject ] ) -> andFilterWhere ( [ 'like' , 'template_body_html' , $ this -> template_body_html ] ) -> andFilterWhere ( [ 'like' , 'template_body_text' , $ this -> template_body_text ] ) ; return $ dataProvider ; }
Creates data provider instance with search query applied
 @param array $params
Creates data provider instance with search query applied @param array $params
// add conditions that should always apply here // uncomment the following line if you do not want to return any records when validation fails // $query->where('0=1'); // grid filtering conditions