M
M
Messi2018-09-24 16:25:04
Yii
Messi, 2018-09-24 16:25:04

Filter on one page and data on another?

Hello! Please tell me how to implement it correctly (without code, just points):
We need a separate page with a filter and a separate page with the output of filtered data.
I have a generic controller like SiteController made two actions, actionIndex and actionFilter.
In the view filter I want to make a form, but the form needs $model. So in actionFilter you need to do $model = new MyModel;
But how then to transfer the filtered data to index?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2018-09-24
@FitTech

The page with the filter has a form, the form sends a get request to the index, and there everything is standard from gii. In fact, you separately render for the standard view-shki _search.php

D
Dmitry, 2018-09-24
@slo_nik

Good afternoon.
Perhaps so.

return $this->redirect('index', ['model' => $model);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question