[eluser]oste15[/eluser]
Hello,
I am wondering what the best way to run code on each page without having to add it into each controller.
For example if you want to check if a user is logged in on each page, and send them to the login page if they are not logged in. You could add the following to each controller, but I think it would be best to just write this once and run it on each page no matter what.
Code:
if(!$user){
//send to login
}
Thanks for clearing this up for me.