/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Todolist::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     if (!($this->load($params) && $this->validate())) {
         return $dataProvider;
     }
     $query->andFilterWhere(['idtodolist' => $this->idtodolist, 'idtodo' => $this->idtodo, 'iduser' => $this->iduser, 'reminder' => $this->reminder, 'cdate' => $this->cdate, 'mdate' => $this->mdate]);
     $query->andFilterWhere(['like', 'name', $this->name]);
     return $dataProvider;
 }