该项目是使用 CakePHP-1.3 开发的
现在我正在尝试升级到 CakePHP-2.0
我已经使用 CakePHP-2.0 约定重命名了所有控制器和模式。
现在,如果我重新加载页面,我会收到如下错误:
Indirect modification of overloaded property PostsController::$Auth has no effect [APP/Controller/PostsController.php, line 11]
编码:
帖子控制器:
$this->Auth->allowedActions =
array('index','view','archive','listarchive','viewfromcategory','tags','aboutme','contact','polls');
应用控制器:
class AppController extends Controller {
var $components = array('Acl', 'Session', 'Auth','RequestHandler');
//var $helpers = array('Html', 'Form','Js','Session','Cache');
var $helpers = array('Html', 'Form','Js','Session');
function beforeFilter() {
//Configure AuthComponent
$this->Auth->actionPath = 'controllers/';
$this->Auth->allowedActions = array('display');
//$this->Auth->authorize = 'actions';
$this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
$this->Auth->logoutRedirect = array('controller' => 'posts', 'action' => 'index');
$this->Auth->loginRedirect = array('controller' => 'posts', 'action' => 'index');
}
我该如何解决这个问题?