2017 © Pedro Peláez
 

library navigation

ZF2 Module which simplifies creationiewing menus

image

t4web/navigation

ZF2 Module which simplifies creationiewing menus

  • Wednesday, December 2, 2015
  • by maxgu
  • Repository
  • 2 Watchers
  • 0 Stars
  • 117 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 4 % Grown

The README.md

Navigation

ZF2 Module which simplifies creating and viewing menus, (*1)

Usage

Add Navigation repo in yours require in composer.json:, (*2)

"repositories": [
    {
        "type": "git",
        "url": "https://github.com/t4web/navigation.git"
    }
],
"require": {
    "t4web/navigation": "dev-master"
}

In your project, for example in modules/Application/Module.php, you can add Navigation service:, (*3)

'factories' => array(
      'UserNavigation' => function (ServiceLocatorInterface $sl) {
          $factory =  new T4webNavigation\Factory();
          return $factory->createService($sl);
      },
  )

In your BootstrapListener you can add menu entries:, (*4)

public function onBootstrap(EventInterface $e)
{
    $sl = $e->getApplication()->getServiceLocator();
    $navigarot = $sl->get('T4webNavigation\Menu\Navigator');
    $navigator->addEntry('Dashboard', 'home', 'fa fa-dashboard');
    $navigator->addEntry('Employees', 'employees-list', 'fa fa-users');
    $navigator->addEntry(TITLE, ROUTE, ENTRY_ICON_CLASS);
}

where TITLE - title in meny entry, ROUTE - route from module config, ENTRY_ICON_CLASS - class for <i> tag., (*5)

After this you can add in your layout menu rendering:, (*6)

<?= $this->navigation('UserNavigation')
    ->menu()->setUlClass('navigation')
    ->setPartial('navigation'); ?>

will be render:, (*7)

<ul class="navigation">
    <li>
        <a href="/"><i class="fa fa-dashboard"></i><span class="mm-text">Dashboard</span></a>
    </li>
    <li class="active">
        <a href="/employees"><i class="fa fa-users"></i><span class="mm-text">Employees</span></a>
    </li>
</ul>

For customizing menu you can copy partial from vendor/t4web/navigation/view/partials/navigation.phtml to your module and modify it., (*8)

The Versions

02/12 2015

dev-master

9999999-dev https://github.com/t4web/Navigation

ZF2 Module which simplifies creationiewing menus

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

zf2 navigation

02/12 2015

1.0.5

1.0.5.0 https://github.com/t4web/Navigation

ZF2 Module which simplifies creationiewing menus

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

zf2 navigation

02/12 2015

1.0.4

1.0.4.0 https://github.com/t4web/Navigation

ZF2 Module which simplifies creationiewing menus

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

zf2 navigation

02/12 2015

1.0.3

1.0.3.0 https://github.com/t4web/Navigation

ZF2 Module which simplifies creationiewing menus

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

zf2 navigation

28/11 2015

1.0.2

1.0.2.0 https://github.com/t4web/Navigation

ZF2 Module which simplifies creationiewing menus

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

zf2 navigation

24/10 2015

1.0.1

1.0.1.0 https://github.com/t4web/Navigation

ZF2 Module which simplifies creationiewing menus

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

zf2 navigation