Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scharrier/li3_menu
Lithium menu generator
https://github.com/scharrier/li3_menu
Last synced: 20 days ago
JSON representation
Lithium menu generator
- Host: GitHub
- URL: https://github.com/scharrier/li3_menu
- Owner: scharrier
- Created: 2013-02-16T00:19:36.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-05-22T10:09:08.000Z (over 9 years ago)
- Last Synced: 2024-10-12T10:47:23.976Z (about 1 month ago)
- Language: PHP
- Size: 156 KB
- Stars: 5
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
li3_menu : Lithium menu generator
=================================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 :
```php
Libraries::add('li3_menu') ;
```And in your view :
```php
$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```php
$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']
));
```