0

我正在关注 CakePHP 带来的 Auth 教程,但遇到了一个奇怪的问题。基本上,我试图在从 AppController 文件中的 components 变量调用它时设置身份验证,而不是按照教程建议的那样在 beforeFilter 操作中分配值。现在我的 components 变量看起来像这样:

public $components = array(
  'Acl',
  'Auth' => array(
    'authorize' => array(
      'Actions' => array('actionPath' => 'controllers')
    ),
    'loginRedirect' => array('controller' => 'posts', 'action' => 'index'),
    'logoutRedirect' => array('controller' => 'display', 'action' => 'home')
    //)
  ),
  'Session'
);

当我尝试运行此代码时,我收到错误Fatal error: Class 'AppController' not found in C:\wamp\www\cakephp\lib\Cake\Controller\CakeErrorController.php on line 31。奇怪的是,如果我只是注释掉 logoutRedirect 行,一切正常。你对正在发生的事情有任何线索吗?

4

0 回答 0