Is this what you're referring to? "Please also remember to call AppController’s callbacks within child controller callbacks for best results"
It's just saying to call the parent callback IF you include a callback in your controller. On Tue, Dec 11, 2012 at 4:02 PM, alaxos <[email protected]> wrote: > While answering a recent question on stackoverflow (http:// > stackoverflow.com/questions/13825073/always-call-a-function-in- > cakephp), I discovered that it seems to be recommended in the cookbook > to always override the AppController beforeFilter() in child > controllers (http://book.cakephp.org/2.0/en/controllers.html#the-app- > controller), even if it is only to call the AppController's > beforeFilter() method like this: > > public function beforeFilter() { > parent::beforeFilter(); > } > > My feeling is that in OO programming, this is useless, because if we > don't override a method in a child class, the parent method is used. > > I do know that when the beforeFilter() method is not overridden in > child controllers, the AppController's beforeFilter() is indeed > called, but as it is recommended in the cookbook, is there any > advantage to do so ? Am I missing something here ? > > -- > Like Us on FaceBook https://www.facebook.com/CakePHP > Find us on Twitter http://twitter.com/CakePHP > > --- > 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]. > Visit this group at http://groups.google.com/group/cake-php?hl=en. > > -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- 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]. Visit this group at http://groups.google.com/group/cake-php?hl=en.
