Skip to content

lavary/menus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Menus

A nice Menu builder for PHP.

Version Build

To install it, use composer:

composer require lavary/menus

You can create a menu by calling make() method.

Here's a basic usage:

<?php

use Lavary\Menus\MenuBuilder;

$builder = new MenuBuilder();

$builder->make('MyNavBar', function($menu) {
  
  $menu->add('Home');
  
  $menu->add('About', ['url' => 'about', 'class' => 'foo bar', 'data-role' => 'item'])->data('weight', 15);
  $menu->about->add('Goals', 'about/goals');
  
  $menu->add('services', 'services');
  $menu->add('Contact', 'contact');
  
});

echo $builder->get('myNavBar')->asBootstrap(['navbar-inverse']);

// or

echo $builder->get('myNavBar')->asUl();

Please checkout the documentation to learn about all the features.

If You Need Help

Please submit all issues and questions using GitHub issues and I will try to help you.

License

Menus is free software distributed under the terms of the MIT license.

About

A nice Menu builder for PHP +5.4 and 7

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages