I want to pass additional params through the URL helper and router – that therefore will not appear in the address bar – but are accessible via the getParam call
My route is below – notice the tagID I want to be passed invisibly though
'router' => array(
'routes' => array(
'tag' => array(
'route' => '/tag/:tag',
'defaults' => array(
'module' => 'default',
'controller' => 'tags',
'action' => 'profile',
'tag' => '',
'tagID' => ''
)
)
)
The URL helper specifies the TagID
url(array(‘tag’ => $tag, ‘tagID’ => $v->id), ‘tag’, true) ?>
Basically is this possible to then get the address bar to show
localhost.com/tag/php
but the controller to have access to the tag and tagID params?
Cheers
Ian
This isn’t possible as far as I know. There’s nowhere to hide any variables because you’re dealing with a standard GET request. This is really about the http protocol, not Zend.
There are two ways of moving data/state between urls: GET (i.e. Encoded into the actual URL and POST.
As a POST request isn’t appropriate here you’re unfortunately stuck with visible URL parameters, or reconstructing the tagID from the tag name on the receiving page.