【发布时间】:2013-02-08 17:04:29
【问题描述】:
我想根据布局加载帮助程序。 我想要这样的东西,但 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';
}
}
感谢您的帮助 问候
【问题讨论】:
标签: cakephp layout helpers cakephp-2.2