2017-05-05 72 views
0

我CakePHP的URL看起來像this.I參數要訪問的參數表名如何從URL訪問CakePHP中2.9.7

http://cakephp-2.9.7/fetchPages/index/table_name:House_Price 

我曾嘗試:

$table_name = $this->request->query('table_name'); 
$table_name = $this->request->data('table_name'); 
$table_name = $this->request->query['table_name']; 
$table_name = $this->request->getQuery('table_name'); 

沒有什麼工作我都可以。

回答

2

這些Named Parameters

你必須使用這樣

$this->request['named']['table_name'] 

$this->request->params['named']['table_name'] 

$this->params['named']['table_name'] 

$this->passedArgs['table_name'] 
+0

謝謝你這麼much.This幫了我很多 – Manasa