H
H
hollanditkzn2017-03-27 13:03:29
Yii
hollanditkzn, 2017-03-27 13:03:29

How to make the search work and display the defined grid data?

I implemented the data so that the data is displayed by status, but in this case I can’t

$dataProvider = new ActiveDataProvider([
            'query' => Zakaz::find()->where(['status' => Zakaz::STATUS_MASTER, 'action' => 1])
            ]);
return $this->render('master', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);

And I need to throw this code for the search to work
$searchModel = new ZakazSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2017-03-27
@hollanditkzn

Read carefully:
www.yiiframework.com/wiki/653/displaying-sorting-a...
www.yiiframework.com/wiki/621/filter-sort-by-calculated

D
Dmitry, 2017-03-27
@slo_nik

God!!! Yes, how much can you procrastinate the same topic?!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question