Cakephp $ this-> request-> params ['pass'] [0]是什么意思?

问题描述 投票:5回答:1

嗨,我需要这行代码的帮助,我已经在我找到$this->request->params['pass'][0]的文档中搜索但是我无法理解它的用途是什么

$this->request->params['pass'][0]是什么意思?

有人可以帮助我吗?

php cakephp cakephp-2.0
1个回答
10
投票

http://book.cakephp.org/2.0/en/controllers/request-response.html

$this->request->params['pass'] 

表示url中传递的参数

示例:您的请求网址localhost/calendars/view/recent/mark

recentmark都被传递给CalendarsController::view()

$this->request->params['pass']是一个值array ([0]=>recent [1]=>mark)的数组

所以,在上面的例子中

$this->request->params['pass'][0] = "recent"
© www.soinside.com 2019 - 2024. All rights reserved.