H
H
hollanditkzn2017-09-15 11:36:56
Yii
hollanditkzn, 2017-09-15 11:36:56

How to make conditions for a specific controller?

It is necessary for me that the menu was not displayed at a certain page, it is possible the controler. This menu is in the views/layout template.
How to define a controller in a template, I never found an answer, only I found defaultRouter so that it was not displayed.
I hope I wrote clearly, if not, how can I simply refer to the controller defined in the template

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2017-09-15
@hollanditkzn

Implementing checks in the view to hide the menu depending on the current action is bad practice.
It is better to make two layers, one with the menu and the other without it, and in the controller, determine which of the layers you need to draw using the layout property

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question