管理员布局不会改变以下路线和app_controller中的代码行
在routes.ctp中有这个:
* ...and setup admin routing
*/
Router::connect('/admin/:controller/:action/*', array('action' => null, 'prefix' => 'admin', 'admin' => true, 'layout' => 'admin' ));
/**
* ...and set the admin default page
*/
Router::connect('/admin', array('controller' => 'profiles', 'action' => 'index', 'admin' => true, 'layout' => 'admin'));
appcontroller中的有这个:
public function beforeFilter()
{
$this->Auth->allow('*');
}
public function beforeRender()
{
$this->_configureErrorLayout();
}
public function _configureErrorLayout()
{
if ($this->name == 'CakeError')
{
if ($this->_isAdminMode())
{
$this->layout = 'admin';
} else {
$this->layout = 'default';
}
}
}
public function _isAdminMode()
{
$adminRoute = Configure::read('Routing.prefixes');
if (isset($this->params['prefix']) && in_array($this->params['prefix'], $adminRoute))
{
return true;
}
return false;
}
我做错了什么