Hi All, 
I've set up a new zf2 pj using zftool.phar, then downloaded the library
using composer, so I have just the skeleton working and ready. I've added 3
actions inside the index controller, child1Action(), child2Action() and
page2Action(), with their view scripts.

I've added this line of code within the layout to render the navigation  
< ? php echo $this->navigation('navigation')->menu(); ? > and this is the
configuration that I've added within the module.config.php

[..]

    'navigation' => array(
         'default' => array(
             array(
                 'label' => 'Home',
                 'route' => 'home',
             ),
             array(
                 'label' => 'Page #1',
                 'uri' => '#',
                 'pages' => array(
                     array(
                         'label' => 'Child #1',
                         'controller' => 'index',
                         'action' => 'child1'
                     ),
                     array(
                         'label' => 'Child #2',
                         'controller' => 'index',
                         'action' => 'child2'
                     )
                 ),
             ),
             array(
                 'label' => 'Page #2',
                 'controller' => 'index',
                 'action' => 'page2'
             ),
         ),
     ),

[..]

and added the service manager config for navigation

[..]
    'service_manager' => array(
         [...]
        'factories' => array(
            'navigation' =>
'Zend\Navigation\Service\DefaultNavigationFactory',
        )
         [...]
    ),
[..]

Everything works fine, I have my menu rendered, If I am, for example, in
this location

"http://mylocalsite/application/index/child1"; or this location 
"http://mylocalsite/application/index/page2";

all menĂ¹ label all correctly linked to their resource, this is the html



here the problem, if I am in the location "/", all links seems to be messed
up, they points all to "/", 
this is the rendered html



Routing rules are the ones generated by zftool. 
Is this the correct behaviour?
Thanks.



-----
Sergio Rinaudo's Blog 
--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/ZF2-Help-needed-to-understand-this-navigation-behaviour-tp4659974.html
Sent from the Zend Framework mailing list archive at Nabble.com.

--
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com


Reply via email to