Manasa
Manasa

Reputation: 187

how to access parameters from url in cakephp 2.9.7

My Cakephp URL looks like this.I want to access the parameter table_name

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

What i have Tried:

$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');

Nothing is working fine with me.

Upvotes: 0

Views: 62

Answers (1)

Aman Rawat
Aman Rawat

Reputation: 2625

These are Named Parameters

You have to use it like this

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

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

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

$this->passedArgs['table_name']

Upvotes: 2

Related Questions