Auth allow()错误

时间:2014-02-12 09:34:19

标签: cakephp-2.0

我运行了我的login.ctp ....它给了我一个致命的错误,说“在非对象上调用成员函数allow()”我不知道如何解决它...这是我的AppController它在beforeFilter函数中有错误:

       public $component1 = array(
             'Session', 'Auth' => array(
                                    'loginRedirect' => array(
                                    'controller' => 'users',
                                   'action' => 'home'
                                  ),
            'logoutRedirect' => array(
            'controller' => 'users',
            'action' => 'login'
                  )
               )
           );

         function beforeFilter(){     
         parent::beforeFilter();    
         $this->Auth->allow('add','view');

1 个答案:

答案 0 :(得分:0)

您应该将public $component1更改为public $components

相关问题