我正在尝试将命名参数传递给函数。它实际上是在之前通过的$this->request->is('post')
,但 debugKit 放在此行返回之后null
。是什么赋予了?
路线:
http://localhost/bake/users/login/ref:post
控制器:
public function login() {
//it returns 'post' here successfully.
debug($this->params['named']['ref']);
if ($this->request->is('post')) {
//it returns 'null' here.
debug($this->params['named']['ref']);
}
}