> I did do as suggested below and it didn't work, I tried both return
> $level and $this->set('level', $level), both failing to return the
> value to the controller. Writing my own function and calling it
> $this->levelcheck() was the only way it seemed to work.
you don't want to 'set' the variable to the view, or return it, simply do:
function beforeFilter()
{
$level_check = $this->othAuth->group('level');
if (!empty($level_check))
{
$this->level = $level_check;
} else {
$this->level = 0;
}
}
alternatively you could put the call to $this->levelCheck() into your
beforeFilter().
eg:
function beforeFilter()
{
$this->levelCheck();
}
FYI any member variables set in app_controller are available to all
controllers, because all controllers extend app_controller. This means
you do not need to use return $var in beforeFilter.
hth
jon
--
jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" 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
-~----------~----~----~----~------~----~------~--~---