Unlike Zend (with uses an Action suffix to designate controller actions), Cake doesn't have any such thing and instead uses a blacklist of 'private' controller actions (defined in the dispatcher).
As such, be aware that new methods defined in the controller could 'potentially' be called as an action, even if that is not the expected behavior. Business logic (on the data validation side) definitely should go into the model. Validation on the input side should do into the controller. Ideally, public functions only validate input and data and then pass the 'correct' data to utility methods, either in the same object or in a special Business Logic type object. My firm actually uses a full-blown domain model / pattern, and uses Cake only for the active record layer, while the Business Logic is largely held in a separate layout above Cake's data access. As with any other solutions, I would spend some time up front trying to determine where you want your site to develop in the future, and making sure that you don't put in quick hacks just because they are easy. It will bite you later on down the road. -----Original Message----- From: Siebren Bakker <[EMAIL PROTECTED]> Reply-To: [email protected] To: [email protected] Subject: Re: inserting more layers into cake php Date: Fri, 20 Jun 2008 03:36:10 -0500 Pretty much all of the business logic for a cake application is supposed to take place in the controller, as this is how MVC frameworks are designed to work. This puts all of your logical code in one location, where it can easily be found and modified. I've found that when adding new functions into my controllers that alphabetizing the functions in the controller file, and putting an extra newline between functions keeps my code readable, and allows quick and relatively painless scrolling to the appropriate code. Your controller does become large, but as long as you keep things organize, this is not really an issue. In the name of Life, Liberty, and the pursuit of my sanity. Siebren Bakker(Aevum Decessus) On Fri, Jun 20, 2008 at 00:48, SajjadRaza <[EMAIL PROTECTED]> wrote: Hi i am novice to php and cake i have shifted from java and now in fix about lkayer distribution wher i ahev to put my businaess logic the suggested place is controller but by this my contrller becomes large can i put my logic in the model or some where else in the i want to work in the following layers view Controller businessLogic and model please guide me in theis regard thanks zaidi ++ Beatport DIGITAL DOWNLOAD NETWORK™ Ian Zepp - Software Engineer, RHCE, ZCE, CMDEV www.beatport.com - Access the world of club music™ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
