Making a zend routes default paramaters display in the URL
Posted
by
NaNuk
on Stack Overflow
See other posts from Stack Overflow
or by NaNuk
Published on 2012-07-11T15:13:08Z
Indexed on
2012/07/11
15:15 UTC
Read the original article
Hit count: 173
zend-framework
|zend-route
I have a route defined as below.
$route['manage-vehicles'] = new Zend_Controller_Router_Route(
'vehicles/manage/page/:page',
array(
'controller' => 'vehicles',
'action' => 'manage',
'page' => '1'
)
);
When the 'page' parameter is not specifically defined (e.g. in a menu constructed using the navigation component), the resultant URL is
/vehicles/manage/page
I would much prefer or the URL not to to display the default paramater key in this scenario
i.e. /vehicles/manage
Any ideas how to accomplish this would be appreciated?
Thanks.
© Stack Overflow or respective owner