Hey everyone, I have a simple question. Is it possible to call a controller method from a model? I can't seem to figure it out if it is possible. Should I just be returning something from the model to the controller rather than trying to call a method directly? Thanks, Pat
+3
A:
Should I just be returning something from the model to the controller rather than trying to call a method directly
Indeed, that's the correct approach. I'm sure there must me some ways to call some methods from the controller, but you shouldn't use them. A model must encapsulate all the logic, business and alike, of the domain problem you are working with. A controller only needs to send and receive messages between models, and back to the views.
Yaraher
2009-09-16 03:45:41