Excuse me, a website home has a lot of modules, each module in the background corresponding to a controller, then this home page show how to deal with?
For example: A travel site, home page shows a destination recommendation and route recommendations. The first page of the recommended query results can also be
displayed on the home page of the destination and on the first page of the line. So how can this reusable query be handled?
Before considering is in the home module through the Runcontroller call each controller inside the method, a little problem, and feel not very good, I see other people's source code is pretty simple. There are no controllers everywhere to call
Reply to discussion (solution)
With the Yii pendant, each page calls the same pendant.
With the Yii pendant, each page calls the same pendant.
Thank you, you said I understand.
However, there is a problem, there is a set to the controller C1 corresponding to the page in the foreach display, but this collection of data is to be through the controller C2 and C3 query together, how to deal with this?
Is it possible to find the data of C2 and C3 directly in the C1 controller?
Or you write a public method in the components!
Create comment classes in components, write public methods, and other controllers can be called.
Create comment classes in components, write public methods, and other controllers can be called.
I see, thank you.
Is it possible to find the data of C2 and C3 directly in the C1 controller?
Or you write a public method in the components!
Thank you.