Commits

David Lukas committed f2e6984

Navigation configuration test

Comments (0)

Files changed (2)

config/module.config.php

         'instance'  => array(
             'alias'     => array(
                 'tw-bootstrap-demo'     => 'DluTwBootstrap\Controller\DemoController',
+                'nav-menu-main'         => 'Zend\Navigation\Navigation',
             ),
             'Zend\View\Resolver\TemplatePathStack'  => array(
                 'parameters'    => array(
                     ),
                 ),
             ),
+            'tw-bootstrap-demo'         => array(
+                'parameters'    => array(
+                    'navbar'    => 'nav-menu-main',
+                ),
+            ),
+            'nav-menu-main'             => array(
+                'parameters'    => array(
+                    'pages' => array(
+                        array(
+                            'label'     => 'Demo',
+                            'title'     => 'DluTwBootstrap Demo',
+                            'uri'       => '#',
+                            'pages'     => array(
+                                array(
+                                    'label'         => 'Forms',
+                                    'title'         => 'Forms Demo',
+                                    'module'        => 'DluTwBootstrap',
+                                    'controller'    => 'tw-bootstrap-demo',
+                                    'action'        => 'form'
+                                ),
+                                array(
+                                    'label'         => 'NavBar',
+                                    'title'         => 'NavBar Demo',
+                                    'module'        => 'DluTwBootstrap',
+                                    'controller'    => 'tw-bootstrap-demo',
+                                    'action'        => 'navbar',
+                                ),
+                            ),
+                        ),
+                    ),
+                ),
+            ),
         ),
     ),
 );

src/DluTwBootstrap/Controller/DemoController.php

 class DemoController extends ActionController
 {
     /**
+     * NavBar
+     * @var \Zend\Navigation\Navigation
+     */
+    protected $navbar;
+
+    /* ***************************** METHODS ****************************** */
+
+    /**
      * Form action
      * @return \Zend\View\Model\ViewModel
      */
         ));
         return $viewModel;
     }
+
+    /**
+     * Navbar action
+     * @return \Zend\View\Model\ViewModel
+     */
+    public function navbarAction() {
+        \Zend\Debug::dump($this->navbar);
+        die('Check');
+        $viewModel      = new ViewModel(array(
+        ));
+        return $viewModel;
+    }
+
+    public function setNavbar(\Zend\Navigation\Navigation $navbar) {
+        $this->navbar   = $navbar;
+    }
 }