Better Way To Have Different Rendering ?

Hello there,

I’m currently doing a report interface, and one of the sections must give some summaries. But, depending on the search/filter options the user choose, I’ve some useless columns and I don’t want to display them.

I can do it in the controler and switch to the appropriate view depending on the search parameters, or doing it directly in the view.

What is, in your opinion, the best way ? One of my ideas ? Another one ?



According to MVC, Controllers have to do anything of fetching data and forwards to viewer,

But if you have to do much more work based on MVC architecture, maybe you could decline a little for that, but make sure that there will be not securing issues :)

I also think that having the management in the controller is more logical, considering each search query as a different action, even if the user don’t know it. And it’ll be easier to maintain.

I agree with you.

In general cases all logical have to be manipulated in Controller

But there are few cases that is not so easy and you have to break the rules (especially between Controller and Viewer) but this is not nessesary <_<