title: zf2 navigation - 'Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for navigation'
body: <p>Hy everybody!</p>
  
  <p>I am learning zf2, and trying to set up a navigation panel(based on: <a href="https://stackoverflow.com/questions/11397226/zend-framework-2-zend-navigation">Zend Framework 2: Zend_Navigation</a>), but the answer from the computer is still:</p>
  
  <p>An error occurred
  An error occurred during execution; please try again later.
  Additional information:
  Zend\ServiceManager\Exception\ServiceNotFoundException
  File:
  /var/www/zf2-tutorial/vendor/zendframework/zendframework/library/Zend/ServiceManager/ServiceManager.php:453
  Message:
  Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for navigation</p>
  
  <p>The module.config.php contain:</p>
  
  <pre><code>   'servicemanager' =&gt; array(
          'factories' =&gt; array(
              'navigation' =&gt; function($sm) {
                  $config = $sm-&gt;get('Config');
                  $navigation = new \Zend\Navigation\Navigation($config-&gt;get('navigation'));
                  return $navigation;
              }
          ),
      ),
  </code></pre>
  
  <p>I have an application.global.php in the main config/autoload folder which is looks like:</p>
  
  <pre><code>&lt;?php
  
  return array(
      // All navigation-related configuration is collected in the 'navigation' key
      'navigation' =&gt; array(
          // The DefaultNavigationFactory we configured in (1) uses 'default' as the sitemap key
          'default' =&gt; array(
              // And finally, here is where we define our page hierarchy
              'Album' =&gt; array(            
                      'label'      =&gt; 'Albumlista',
                      'route'      =&gt; 'album',
                      'action' =&gt; 'index',
                      'pages'      =&gt; array(
                          array(
                              'label'      =&gt; 'Add',
                              'route'      =&gt; 'album',
                              'action'     =&gt; 'add'
                              )           
                         )
                 ),
              'Application' =&gt; array(            
                      'label'      =&gt; 'Alap alkalmazás',
                      'route'      =&gt; 'application',
                      'action' =&gt; 'index',
  
                 )
          ),
      ),
  
  );
  </code></pre>
  
  <p>And from the controller i give this command:</p>
  
  <pre><code>$config = $this-&gt;getServiceLocator()-&gt;get('navigation');
  </code></pre>
  
  <p>Could somebody help me to solve this problem?
  I read about <a href="http://adam.lundrigan.ca/2012/07/quick-and-dirty-zf2-zend-navigation/" rel="nofollow noreferrer">http://adam.lundrigan.ca/2012/07/quick-and-dirty-zf2-zend-navigation/</a> , I tried it, and I did it, but I would like to combine with acl so that I wrote this question.</p>
  
  <p>Thanks for every help!</p>