What's the way to have a global variable inside a controller?
I have tried to do it using beforeFilter but it is not accessible from the others functions.
Can it only be done using Configure::read
and Configure::write
What's the way to have a global variable inside a controller?
I have tried to do it using beforeFilter but it is not accessible from the others functions.
Can it only be done using Configure::read
and Configure::write
you can set variable accessible in any controller in your AppController
then in your other controller you can access variable anywhere like this