0
我需要在$ this-> params中做些什麼AppController::beforeFilter()
我得到Notice (8): Undefined variable: a
,但是當我將它設置在beforeFilter()
中時,b
變量正常設置。這是正常的行爲嗎?如果不是,我如何獲得參數beforeFilter()
?如果在採取任何行動之前我能夠使用這些參數,那本來會更好。
function beforeFilter() {
$this->set('a', $this->params);
}
function beforeRender() {
$this->set('b', $this->params);
}