Widget_Controller for different types of data (MVC)

Posted by steve-o on Stack Overflow See other posts from Stack Overflow or by steve-o
Published on 2010-04-21T09:29:08Z Indexed on 2010/04/21 9:33 UTC
Read the original article Hit count: 190

Filed under:
|
|
|

Hello, I have a few widgets I need to show on a site - they are all relating to different types of data (e.g user, house). Each type of data and its relations is represented in specific models, but as far as a controller or helper is concerned, is it an ok plan to have a generic Widget controller/helper which generates the necessary widgets, even though each widget is dealing with distinct data? I don't really want to generate these widgets within the User and House controllers, as these controllers are dealing with different types of functionality.

I'd imagine that the Widget_Controller could just contain static methods for generating these widgets, e.g: Widget_Controller::user_panel();

Does that make sense? Cheers!

© Stack Overflow or respective owner

Related posts about mvc

Related posts about oop