我想根据布局加载助手。我想要这样的东西,但 id 不起作用:
function beforeRender(){
if (array_key_exists($this->request->action, $this->custom_layouts)){
public $helpers = array('Html', 'Form', 'Session', 'Menu1');
$this->layout = $this->custom_layouts[$this->action];
}else{
public $helpers = array(
'Session',
'Html' => array('className' => 'TwitterBootstrap.BootstrapHtml'),
'Form' => array('className' => 'TwitterBootstrap.BootstrapForm'),
'Paginator' => array('className' => 'TwitterBootstrap.BootstrapPaginator'),
'Menu1'
);
$this->layout = 'default';
}
}
感谢您的帮助