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
Post a Comment