you cant juse declare public $helpers
inside methods.
You need to call it as PHP wants it to be called:
$this->helpers[] = 'Menu1';
$this->helpers['Html'] = array('className' => 'TwitterBootstrap.BootstrapHtml');
...
문제
i would like to load helpers depending on layouts. i want something like this, but id doesnt't work:
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';
}
}
thanks for any help regards
해결책
you cant juse declare public $helpers
inside methods.
You need to call it as PHP wants it to be called:
$this->helpers[] = 'Menu1';
$this->helpers['Html'] = array('className' => 'TwitterBootstrap.BootstrapHtml');
...