In my AppController I have
<?php
class AppController extends Controller {
var $components = array('Acl', 'Auth');
function beforeFilter() {
//Configure AuthComponent
$this->Auth->authorize = 'actions';
$this->Auth->loginAction = array('controller' => 'users',
'action' => 'login');
$this->Auth->logoutRedirect = array('controller' => 'users',
'action' => 'login');
$this->Auth->loginRedirect = array('controller' => 'posts',
'action' => 'add');
}
}
?>
which I was under the impression would make the components available
in all the controllers I am using in the app.
function beforeFilter() {
$this->Auth->allow('add', 'index', 'login','logout');
}
in a controller however gives me the "Call to a member function on a
non-object" error unless I add
var $components = array('Acl', 'Auth');
to that controller too, which obviously isn't much of a problem, but I
would like to understand why, as I am very new to cakePHP and would
like to understand why.
Thanks for any pointers!
Taff
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---