mercredi 23 novembre 2016

Kohana 3.3 PHP global variable

I'm using Kohana 3.3 web framework.

I have bunch of controllers that inherit one abstract controller with function before() in which I check if user is currently logged in. The problem is that I want to set a global variable when the user is logged in and that variable needs to be accessible/visible from all other controllers. I've tried to make the variable 'public' before the before() method, but when I open another controller to access the variable it throws error "Undefined variable".

Aucun commentaire:

Enregistrer un commentaire