Am 27.04.2012, 09:39 Uhr, schrieb dershao <[email protected]>:
I think we are discussing different things here:
Frank is absolutely right: The navigation works fine in the unit tests.
But cmple and I are trying to use this component in a view template to
generate links.
The difference are the following lines:
1. $urlHelper->setRouter($router);
2. $urlHelper->setRouteMatch($routeMatch);
3. \Zend\Navigation\Page\Mvc::setDefaultUrlHelper($urlHelper);
In the unit test this dependecies are set explicetly which is not the
case
in a "real" MVC environment.
1. This could be done in the module class, like Mathew showed recently in
his slides:
http://mwop.net/slides/2012-04-25-ViewWebinar/Zf2Views.html#slide41
The router is atm not set in the Skeleton Application.
2. This is discussed here:
https://github.com/zendframework/zf2/pull/952
Short Summary: routeMatch needs to be injected and beause it's
calculated it
should not be done via DI but with a locator. The locator is currently in
RFC status and heavily discussed. If its available in can be injected
manually or via listener (as proposed).
3. Should be set up somewhere like 1. Currently not part of MVC bootstrap
but should be easy to implement on yourself.
--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/Zend-Navigation-problem-tp4256771p4591984.html
Sent from the Zend Framework mailing list archive at Nabble.com.
Right! This all is work in progress.
A simple solution will coming.
--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]