Answer the question
In order to leave comments, you need to log in
What is the best way to make common properties for all views?
Good day.
Let's say we display the latest events \ articles in the sidebar in the menu. To do this, you need to throw in the controller, for example, `$latestEvents`. The latest events should be on each page, which leads to a head-on solution: in each controller, throw `$latestEvents` into the view.
Obviously this is a bad decision. And obviously this must be a fairly well-known case. Of course, I can cycle in the base controller, or create a macro that would mix properties from the config into each view, but perhaps there is a pattern \ good package \ common solution?
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question