-1

I'm using CakePhp2 and trying to get values of variables from a url.

My url looks like controller/action/foo:bar/foo2:bar2/foo3:bar3 ?

When I use $this->request['foo'] CakePhp says "Undefined index".

Any idea to find values of foo, foo2 and foo3?

Dacobah
  • 767
  • 3
  • 15
  • 33

2 Answers2

2

check the documentation on named params. it will most likely be in

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

or even easier/cleaner for 2.x:

$this->request->named

so debug($this->request->named) for details.

mark
  • 21,478
  • 3
  • 46
  • 67
0

Try

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

You want to access the passed arguments.

Ross
  • 17,612
  • 7
  • 42
  • 62
user1661286
  • 123
  • 3
  • 12