sander
sander

Reputation: 53

Zend framework routing params

I have several routes defined in my application. When route A is matched and I assemble an URL using route B without resetting, it does not include the current request parameters.

Is there an easy way to include all the request parameters when assembling an URL via a different route than the current route? I did have a look at Zend_Controller_Router_Rewrite->useRequestParametersAsGlobal, but this will (obviously) also include the request parameters when reset = true

Upvotes: 1

Views: 323

Answers (1)

Raj
Raj

Reputation: 22956

You could try the following.

$oldParams = $this->_getAllParamas();
unset($oldParams['module']);
unset($oldParams['controller']);
unset($oldParams['action']);

Pass

array_merge(array('new'=>'param'),$oldParams)

to your URL view helper.

Upvotes: 0

Related Questions