[eluser]eddieconnecti[/eluser]
Tried the search, but couldn´t find anything helpful about his:
In some other frameworks i worked before, i used interceptors to check whether the user is logged in or not. I used them to handle pre-requests, like calling models for the navigation tree before the view is called and any other controller methods are called.
So what i am looking for is a way to call methods each time a new request starts. In this way i want to call a model, recieve an array of navigation items, push this to the $data object of the controller so the view knows which navigation items to show.
On the same way i want to check on every request if the user is logged in and if he has permissions for the current action. If not, redirect the user to another page.
The advantage is to not write the hole code in every controllers method but having the code in external classes which are automatically called.
Maybe it is possible to do this with hooks or callbacks, but i like the way to have a class for security functions (like a security interceptor) and a class for navigational purposes.
Thanks!