hi > What I want to do is to reduce the code. i.e I want a code to be > placed somewhere and that will be used by all the controllers. How can > I do that? Will it be helpful by placing the code in appcontroller ? > If so, tell me how can I do it...
yes, this is exactly what the cake/app_controller.php file is made for. put your common controller methods in this empty class (AppController). you can make common model methods, as well, in cake/app_model.php. it's maybe even more appropriate to what you describe, because you can use AppModel's properties like $table, $name, etc to make methods which will work for all models. (and also because I think that in MVC, SQL stuff should rather be handled by the models) hope it helps +++++++ clemos --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
