I am setting a variable value that in app_controller beforeFilter, and
I would like to access it in all child controllers beforeFilter
function.
class AppController extends Controller {
var $components = array('Auth');
var $uses = array('User');
$auth_id = $this->Auth->user('id');
if ( $auth_id ) {
$auth_role = $this->User->getRole($auth_id);
}
}
class XController extends AppController {
(...)
function beforeFIlter() {
parent::beforeFilter();
if ($auth_role == "calibrator") {
(...)
}
}
}
When I call a method in XController. I get an $auth_role not defined
error. Is there a way to pass the variable value to the child
controller?
Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---