ez projects / owviewparams
| UNIX name | Owner | Status | Version | Compatible with |
|---|---|---|---|---|
| owviewparams | Simon Boyer | stable | 1.3 | 4.x |
owViewParams template operator generates a new url with all view_parameters you want to preserve, modify, and remove.
You have this url :
http://domain.com/request/(param1)/value1/(param2)/value2
And you want modify the param1 value, remove param2 and add a new parameter, you can use owViewParams operator :
<a href="{'http://domain.com/request'|createUrl( $view_parameters, hash('modify', hash('param1', 'newValue1', 'param3', 'value3'), 'exclude', array( 'param2') ) )}">Test</a>
This will return :
http://domain.com/request/(param1)/new_value1/(param3)/value3
'modify' : used to modify view_parameters values. If a view_parameter doesn't exists, it will be created.
'only' : used to keep only specified view_parameters (added to 'modify' view_parameters)
'exclude' : used to remove specified view_parameters (except 'modify' view_parameters)
---------------------------------------------
Hope you find it useful!
Simon Boyer