Application wide methods

Working with cakephp since 1.3, I have always written application wide methods in the app controller.
Those things that are loaded first and all the times including : building main menu, reading cache, user id (if necessary) and various infos that could be useful (depending on the application).
The question is simple : is it the best practice ?

1 Like

Middleware is now often a good place to put that sort of thing, but not everything works well like that.

My understanding of you answer is that there is not a single way to manage this kind of stuff.
It depends of what it is and the way I need it.
Did I read it well ?

Thank you again

As with most everything, the answer is “it depends”. :slight_smile:

As we say here, it’s a Normand’s answer. (Normands are people living in Normandie).
They are supposed to always answer “Maybe yes, maybe no” :))