S
S
Sergey Bard2018-02-13 16:22:36
Yii
Sergey Bard, 2018-02-13 16:22:36

What is the best way to organize the structure?

Hello. I am learning yii in the process of developing my site, now I need to make a category page, to be more precise, this should be the page on which I will display the definition. goods according to letters, there should be several such filter pages (categories), here is an image of what I need, i.e. I go to op. I press any letter on the page and I should be shown a list of products in which the first letter of the name matches.
D6Kz5O.jpg
so I created an alphabet search page, made a controller and a view, for filtering by model I used the same controller as for the alphabet, only the action was specified differently (I redirect through urlManager), then I plan to do other pages in the same way, through one controller everything , I do this because further it will be necessary to automatically create dynamic categories, for this reason I decided to combine everything into one controller, but I doubt something is correct, please tell me what is the best way ?, all that is static divided into separate controllers, etc., and the rest can be combined.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Stepanov, 2018-02-16
@Exebeche

You need 2 controllers.
One creates a letter selection page and checks if the user has selected a letter.
The second one checks the selected letter and returns items starting with that letter.
And to be without reloading, renderAjax is used

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question