2017 © Pedro Peláez
 

library knp-menu-laravel

Laravel package to create navigation menus, based on KnpLabs/KnpMenu.

image

dowilcox/knp-menu-laravel

Laravel package to create navigation menus, based on KnpLabs/KnpMenu.

  • Friday, November 11, 2016
  • by dowilcox
  • Repository
  • 2 Watchers
  • 4 Stars
  • 1,924 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

KnpMenu-Laravel

Laravel 5 package to create navigation menus, based on KnpLabs/KnpMenu., (*1)

Installation

Add to your composer.json file, (*2)

"dowilcox/knp-menu-laravel": "1.0.*"

Register the package

In config/app.php add the service provider and alias., (*3)

Dowilcox\KnpMenu\MenuServiceProvider::class,
'Menu' => Dowilcox\KnpMenu\Facades\Menu::class,

Publish config

php artisan vendor:publish

Example

$menu = Menu::create('main-menu', ['childrenAttributes' => ['class' => 'nav']]);

$menu->addChild('Home', ['uri' => url('/')]);
$menu->addChild('Users', ['uri' => route('admin.users.index')]);
$menu->addChild('Roles', ['uri' => route('admin.roles.index')]);
$menu->addChild('Menu', ['uri' => url('menu')]);

echo Menu::render($menu);

Will output:, (*4)

<ul class="nav">
  <li class="first">
    <a href="http://localhost:8000">Home</a>
  </li>
  <li>
    <a href="http://localhost:8000/admin/users">Users</a>
  </li>
  <li>
    <a href="http://localhost:8000/admin/roles">Roles</a>
  </li>
  <li class="current active last">
    <a href="http://localhost:8000/menu">Menu</a>
  </li>
</ul>

The Versions

11/11 2016

dev-master

9999999-dev

Laravel package to create navigation menus, based on KnpLabs/KnpMenu.

  Sources   Download

MIT

The Requires

 

The Development Requires

09/06 2015

1.0.1

1.0.1.0

Laravel package to create navigation menus, based on KnpLabs/KnpMenu.

  Sources   Download

MIT

The Requires

 

The Development Requires

13/03 2015

1.0.0

1.0.0.0

Laravel package to create navigation menus, based on KnpLabs/KnpMenu.

  Sources   Download

MIT

The Requires

 

The Development Requires

03/03 2015

0.0.1

0.0.1.0

Laravel package to create navigation menus, based on KnpLabs/KnpMenu.

  Sources   Download

MIT

The Requires