CommonController extends AppController
all common methods here...
(remeber to set parent::beforefilter() etc. if there is controller
callabacks)

App:import('Controller', 'Common');
PostController extends CommonController



On Mar 4, 3:16 pm, ramonmaruko <[email protected]> wrote:
> I have three controllers that have the same code for the index/add/
> edit/delete/view actions. How should I refactor the code so that it'll
> be in just one place, and those three controllers would just inherit
> the actions from somewhere? Currently, I have the actions defined
> inside my AppController class. Each action checks to see if the
> controller that called the action is one the three controllers
> 'expected' to inherit them. Is there a better way of doing this?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to