Nothing stopping you putting things in the model. The "fat model" principle is recommended by lots of people.
Generally I've been baking my controllers to get some basic functionality, then replacing the baked methods with far simplier methods, and moving all the data retrieval over to the model....leaving the controller to take care of business logic. On Mon, Mar 15, 2010 at 7:38 AM, guille1983 <[email protected]> wrote: > Please correct me if I am wrong... > > I think Cakephp breaks the mvc pattern > > If I call a controller action, lets say /post/add > > And I have to do a lot of logical stuff including sending an email, i > think the controller action would be this: > > function add() { > if ($this->Post->myModelFunction){ > $this->flash() ..... > } > } > > and in Post model.... > > function myModelFunction() { > // 20 lines of code.... > } > > But in real life I would have to use a component within the > controller... Wouldn't it better to have such functionalities from the > model?? > I really don't like to write logic in controller (or at least more > than in the model) > > What do you have to say? Do you think Cakephp does not break MVC > pattern? > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<cake-php%[email protected]>For > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
