MVC - thin controller idea - Codeigniter/Zend

Posted by user505988 on Stack Overflow See other posts from Stack Overflow or by user505988
Published on 2011-01-07T09:39:28Z Indexed on 2011/01/07 9:54 UTC
Read the original article Hit count: 150

Filed under:
|

Hi, Could some one possibly clarify this for me. In the MVC paradigm, the idea is to keep the controller as thin as possible, it is also true that the model is the bit that communicates with data sources such as the database, XML-RPC etc and this is where the business logic should go.

Is the POST and GET data a 'data source' and should that kind of data be handled by the model or should it be by the controller.

I would normally call a method in the model and pass it the post data, the data would be quality checked by the controller and the model method would simply do the insertion or whatever. Should it be though that controller just calls the model method if a post has occured and it is responsible for sanity check, data checks etc.

© Stack Overflow or respective owner

Related posts about zend-framework

Related posts about codeigniter