Hello,
When I try to use the navigation menu view helper I don't get the right urls
generated, the actual request params are not used to generate the correct
url it's the defaults route parameters that are used.
Ex:
'router' => array(
'routes' => array(
'lang' => array(
'type' => 'Segment',
'options' => array(
'route' => '/[:lang]',
'defaults' => array(
'lang' => 'en',
),
'constraints' => array(
'lang' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
),
'may_terminate' => true,
'child_routes' => array(
'home' => array(
'type' => 'Zend\Mvc\Router\Http\Literal',
'options' => array(
'route' => '/',
'defaults' => array(
'controller' => 'Application\Controller\Index',
'action' => 'index',
)
)
)
)
)
)
'navigation' => array(
'default' => array(
array(
'label' => 'Home',
'route' => 'lang/home',
)
)
)
$this->navigation('navigation')->menu();
Request = "/" > will generate "/en/home"
Request = "/fr/" > will generate "/en/home" in place of /fr/home
1. Is the way I use it correct?
2. If yes then I suppose there is a bug in \Zend\Navigation\Page::getHref()
Where its not checking for the params of the routeMatch attr, just loading
the default params.
Regards,
Geoffroy
--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/Navigation-MVC-Menu-issue-tp4659301.html
Sent from the Zend Framework mailing list archive at Nabble.com.
--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]