2013-12-18 80 views
4

您好我需要幫助在這行代碼,我已經搜查,我發現$this->request->params['pass'][0]的文檔,但我不明白什麼是它的使用

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

任何人都可以幫我進入這個嗎?

回答

9

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

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

表示URL中傳遞的參數

實施例:你的請求URL localhost/calendars/view/recent/mark

兩個recentmark傳遞參數CalendarsController::view()

$this->request->params['pass']是一個數組價值array ([0]=>recent [1]=>mark)

所以,在上面的例子中

$this->request->params['pass'][0] = "recent"