Answer the question
In order to leave comments, you need to log in
How to fetch source data in DataProvider using Sphinx?
Hello!
I'm making a fetch request to Sphinx. In response, I get the id and the number of entries. Now we need to display the original records in the GridView through the ActiveDataProvider.
How is it implemented?
Answer the question
In order to leave comments, you need to log in
Good afternoon.
So there are examples in the documentation .
Topic on toster.ru
Or something doesn't work for you?
If so, please show your code.
$ids = [1,2,4,768,8797]; // полученные id от сфинкса или еще откуда либо
$dataProvider = new ActiveDataProvider([
'query'=>SomeModel::find()->andWhere(['id'=>$ids]),
]);
echo \yii\grid\GridView::widget([
'dataProvider' => $dataProvider,
]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question