CakePHP - centralizing controller logic?

Put the logic in your AppController class which your controller should extend from Check out the docs: book.cakephp.org/view/957/The-App-Contro....

Put the logic in your AppController class which your controller should extend from. Check out the docs: book.cakephp.org/view/957/The-App-Contro....

– Brian Oct 5 at 20:23 you could have a intermediate class that extends AppController and then have your functions in there and then your controllers would extend from that class. E.g. MyController extends IntermediateController extends AppController – kand Oct 5 at 20:26 Yes, except that even within a controller, only one action may need this functionality.

And if other actions require similar logic of their own, I'd be unable to extend two intermediate controllers. – Brian Oct 5 at 20:28.

Ended up rolling my own sort of business logic layer on this one. Example below. Thoughts/comments welcome.

Class MyController extends AppController { public function my_action() { // The BLL class is specific for this action and gets the entire // controller so has access to the set() method as well as components. $this->Bll = new MyActionLogic($this); $this->Bll->do_whatever(); } }.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions