php - Yii 2 ActiveDataProvider query with ->all() gives "Call to a member function andFilterWhere() on array" error -


i need pass activedataprovider object view , can't understand why this:

$query = incarico::find();  $dataprovider = new activedataprovider([     'query' => $query, ]); 

works, while this:

$query = incarico::find()     ->joinwith('allegatos')                ->all();  $dataprovider = new activedataprovider([     'query' => $query, ]); 

gives me following error:

call member function andfilterwhere() on array

you should not apply all() $query since activedataprovider query property expects valid activequery instance while passing results of query.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -