2017 © Pedro Peláez
 

library zf-bootstrap

ZF2 ViewHelper für Bootstrap 3

image

dwolke/zf-bootstrap

ZF2 ViewHelper für Bootstrap 3

  • Tuesday, May 12, 2015
  • by dwolke
  • Repository
  • 1 Watchers
  • 0 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ZfBootstrap

Simple Module with ViewHelpers for using with ZF2 Navigation with Bootstrap 3., (*1)

Actually created for personal use, but feel free to use this in your own projects., (*2)

Usage

Create your navigation in module.config.php:, (*3)

'navigation' => array(
    'default' => array(
        array(
            'label' => 'Startseite',
            'route' => 'home',
        ),
        //Dropdown-Menu
        array(
            'label' => 'Dropdown-Test',
            'uri' => '#',
            'dropdown' => true,
            'pages'       => array(
                array(
                    'label'   => 'Bar',
                    'route'   => 'bar',
                    'controller'  => 'Application\Controller\Index',
                    'action'      => 'bar',
                ),
                // Menu divider
                array(
                    'type' => 'uri',
                    'divider' => true,
                ),
                array(
                    'label'   => 'Baz',
                    'route'   => 'baz',
                    'controller'  => 'Application\Controller\Index',
                    'action'      => 'baz',
                ),
            ),
        ),
    ),
),

add the navigation to the service manager:, (*4)

'service_manager' => array(

    // this adds the default Navigation
    'factories' => array(
        'my_navigation' => 'Zend\Navigation\Service\DefaultNavigationFactory',
    ),

),

and use the viewhelpers in your view/layout scripts:, (*5)

<?php
    // render only the 'ul'
    echo $this->navigation('my_navigation')->bsNavMenu()->setUlClass('nav navbar-nav');

    // or render the whole Navbar
    echo $this->navigation('my_navigation')->bsNavBar()->setOptions($navbarOptions);

?>

$navbaroptions is an Array with the following options:, (*6)

  • inverse : true | false
  • fluid true | false (container-fluid | container)
  • position (string): fixed-top | fixed-bottom | static-top
  • ulClass (string): the css class for the first 'ul'
  • brandTitle (string)
  • brandLink (string)
  • brandImg (string): path to img
  • brandShowTitle : true | false

all options are optional ;-), (*7)

The Versions

12/05 2015

dev-master

9999999-dev http://dw-labs.de

ZF2 ViewHelper für Bootstrap 3

  Sources   Download

MIT

The Requires

 

bootstrap zf2 zend framework view helper