[英]CakePHP 1.3 - Extract URL GET parameters
我有使用類似 URL 的 CakePHP 1.3.2 應用程序:
/controller/action/name1:value1/name2:value2.html
我正在嘗試提取之前名稱指定的:
符號之后的值。 我可以使用$this->params['url']
毫無問題地查看整個 URL,但是,我無法使用$this->params['name1']
或$this->params['url']['name1']
獲取值本身$this->params['url']['name1']
。 有小費嗎?
URL:/contents/view/chapter:models/section:associations 映射:
內容控制器->視圖(); $this->passedArgs['chapter'] = 'models';
$this->passedArgs['section'] = 'associations';
$this->params['named']['chapter'] = 'models';
$this->params['named']['section'] = 'associations';
所以你應該使用:
$this->params['named']['name1']
$this->params['named']['name2']
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.