You can't just include procedural functions in the middle of a class and expect them to be methods. Includes are not a pre-compiler directive. What you'll need to do is to define every function at least in your controller class file, then you could in theory include the contents of that function. However, this would be slightly crazy, and lead to a lot of includes (one per function that you extracted).
Also, if the code really can't be moved to the models / refactored to generalize into a superclass, or reusable methods then there is probably something wrong with your design. The main reason to split things like controllers up would be to allow for reuse (see components). Bear in mind as well that you have to have a pretty compelling reason to split the file up. Every include you use will increase the parse time, and add overhead to your application. PHP is not after all a compiled language. If your problem is code manageability you may be better served by getting an editor that folds functions (eg eclipse pdt). Simon http://www.simonellistonball.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~----------~----~----~----~------~----~------~--~---
