I seem to be misunderstanding something.
My understanding is that a
can be used to generate urls, for example:
//in a template $this->Html->link('Destination', $params); //or in a general sense Router::url($params);
I’m having a specific failure though. The
pass values are not in the resulting url string.
Details about the structure
The params array carries the pass values on the
pass node. If I move these values into the first level of the params array I an get the url string result I expect.
//doesn't work $params = [ 'controller' => 'Articles', 'action' => 'index', 'pass' => [ 0 => 44, 1 => 'A' ] ]; Router::url($params); //produces // articles/index //does work $params = [ 'controller' => 'Articles', 'action' => 'index', 0 => 44, 1 => 'A' ]; Router::url($params); //produces // articles/index/44/A
I fiddled with writing a route to correct this… I’m not clear on the concepts in the Router and can’t give you specifics because I literally spent 2 hours trying every variation I could think of.
What am I not getting? Are
params arrays not supposed to work like this?