您好我需要帮助这一行代码,我已经在我找到的$this->request->params['pass'][0]
文档中搜索过但我无法理解它的用法是什么
$this->request->params['pass'][0]
是什么意思?
有人可以帮助我吗?
答案 0 :(得分:10)
http://book.cakephp.org/2.0/en/controllers/request-response.html
$this->request->params['pass']
表示url中传递的参数
示例:您的请求网址localhost/calendars/view/recent/mark
recent
和mark
都会将参数传递给CalendarsController::view()
$this->request->params['pass']
是一个值为array ([0]=>recent [1]=>mark)
所以,在上面的例子中
$this->request->params['pass'][0] = "recent"