Error create multi navigation on Zend 2

I using module Application

on module.config.php

...
    // Navigation
    'navigation' => array(
        'default' => array(
            array(
                'label' => 'Product Management',
                'route' => 'product',
            ),
        ),
        'outlet' => array(
            array(
                'label' => 'Outlet Management',
                'route' => 'outlet',
            ),
            array(
                'label' => 'Delivery Order',
                'route' => 'deliveryorder',
            ),
        ),
    ),
...

and layout.phtml

<?php 
echo $this->navigation('navigation')->menu()->setUlClass('nav navbar-nav');
echo $this->navigation('outlet_navigation')->menu()->setUlClass('nav navbar-nav'); 
?>

Error appear when call outlet navigation. How to fix it ?

Answers


You need to create a service for each navigation entry.

Assuming you have this:

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

You will only get the default navigation entries.

If you switch to the Abstract Factory:

'service_manager' => array(
    'abstract_factories' => array(
        'Zend\Navigation\Service\NavigationAbstractServiceFactory'
    ),
),

You can then do:

echo $this->navigation('Zend\Navigation\Default')->menu();
echo $this->navigation('Zend\Navigation\Outlet')->menu();

Need Your Help

How to authenticate user manually from cookie in laravel 5?

php laravel cookies laravel-5 session-variables

I am working on websockets, i am using Rachet. Whenever a user tries to establish a connection, i need to authenticate. My backend uses laravel 5 for all http authentification.

Quickblox-2.4 with Proguard

android proguard quickblox quickblox-android

I am trying to integrate Proguard with Quickblox-2.4 jars. My logcat is showing this exception: