Hi,

 

sorry if it is not detailed enough.

 

I thought the three factory cases are the same.

 

In 1. I used the default factory with navigation in the config.

2. I tried to use the factory to return my own navigation object

3. is the use of a callback to return my navigation object.

 

I thought that these 3 are the same, but they are not. I only can assume that 
the DefaultNavigationFactory makes other things too that are required.

 

 

-----Ursprüngliche Nachricht-----
Von: Jurian Sluiman [mailto:[email protected]] 
Gesendet: Montag, 17. September 2012 09:40
An: Zend Framework
Cc: Marc Tempelmeier
Betreff: Re: [fw-general] Zend\Navigation\Navigation() in getServiceConfig()

 

2012/9/13 Marc Tempelmeier <[email protected]>

Hi,

I´m struggle a bit with my Navigation.Its more code then good for an email, 
therefor I put it on pastebin. I thought that the following cases are nearly 
the same:

1. http://pastebin.com/3U6iAfw5
2. http://pastebin.com/9R1NNKHs
3. http://pastebin.com/HbMXkr4b

The first one works, but the latter two do not. I thought that all 3 
possibilities are the same, maybe someone can throw me in the right direction 
and why the two do not work? What I want is a Navigation object, not building 
it via config.

Thx in advance :)

 

Can you explain what "does not work" means?

 

I've created something very similar and that works as expected. I have a few 
differences, but they all have no influence on the working:

1.      My "ModuleNamespace\Model\Navigation" is just called in the invokables 
from the SM, so no factory is required

2.      I call parent::__construct(), but if you don't have a page config 
array, that call does not really matter

3.      I create Uri pages with the factory

Therefore I think you have problems with your route assembly. You do not 
provide a router, so you have set the default router? You do not provide a 
route for the pages either, so you use one route (like a "magic route")? If you 
do not have a route set, the name of the route in the route match will be used. 
You can assemble an uri with the route match, but if the page from the 
navigation has a different route than the route from the match, that will not 
work. However, to let this happen you must also set a route match, which you do 
not as well.

 

For all these cases (no router set, no route or route match set, assembly 
fails) you will get an exception, so all failures are clearly visible.

-- 
Jurian Sluiman 

Reply via email to