scharrier/li3_menu

There is no license information available for the latest version (dev-master) of this package.

Lithium simple menu generator

Installs: 80

Dependents: 0

Suggesters: 0

Security: 0

Stars: 5

Watchers: 4

Forks: 1

Open Issues: 0

Type:lithium-library

dev-master 2015-05-22 10:09 UTC

This package is not auto-updated.

Last update: 2024-04-13 12:58:59 UTC


README

Creating a menu in Lithium should be easy. This little helper does only one thing : it takes a menu, identifies the active link and render a ul/li menu.

Installation

Just add in your config/bootstrap/libraries.php :

	Libraries::add('li3_menu') ;

And in your view :

    $this->menu->display(array(
      'Home' => '/',
      'My pictures' => '/pictures'
    ));

Advanced usage

You can specify more params into your links by defining them as arrays :

  • url : destination (can be an array or a string)
  • mask : if you wan't to specify a more specific mask. By default, the mask is the destination url.
  • active : if you want to force an active item, set this to (bool) true.
  • class : if you want to add a css class to your item
    $this->menu->display(array(
      'Home' => ['url' => '/', 'mask' => ['controller' => 'home']] // Will be active for all the Home controller actions
      'My pictures' => ['url' => ['controller' => 'pictures', 'action' => my], 'class' => 'my-pictures']
    ));