2017 © Pedro Peláez
 

library extensible-menu

An extensible library to manage menus

image

devitek/extensible-menu

An extensible library to manage menus

  • Saturday, August 20, 2016
  • by CaporalDead
  • Repository
  • 1 Watchers
  • 0 Stars
  • 433 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

An extensible library to manage menus

SensioLabsInsight Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Installing

Add "devitek/menu": "^2.0.0" to your composer.json by running :, (*2)

composer require devitek/menu

And select version : 2.*, (*3)

How to use

You can use it like this :, (*4)

<?php

$html = (new Devitek\Menu\Renderer\TwitterBootstrap\Navbar())
    ->translateWith(new Devitek\Menu\Translator\LaravelTranslator())
    ->resolveUrlWith(new Devitek\Menu\Resolver\LaravelResolver())
    ->isFluid()
    ->handleResponsive()
    ->isFixedTop()
    ->withBrand('My super project', '/')
    ->onTheLeft((new Menu())->with([
        (new IconLink('pages.home.link'))->withDestination('home')->withIcon('glyphicon glyphicon-home'),
    ]))
    ->onTheRight((new Menu())->with([
        (new Devitek\Menu\Items\IconGroup('pages.account.link'))->withIcon('glyphicon glyphicon-user')->need([
            function () { return ! Auth::guest(); }
        ]) ->withUnder([
            (new Devitek\Menu\Items\IconLink('pages.administration.utilisateurs.lien'))->withDestination('administration.utilisateurs')->withIcon('glyphicon glyphicon-cog'),
        ]),
    ]))
    ->render();

In this case, I use the translator provider and route resolver for laravel., (*5)

What's included

Items

Base :, (*6)

  • Item

Classes :, (*7)

  • Link
  • IconLink
  • Group
  • IconGroup
  • Separator

Trait :, (*8)

  • WithIcon

Renderer

Base :, (*9)

  • Renderer

Twitter Bootstrap :, (*10)

  • Navbar

ResolverInterface

Interface :, (*11)

  • ResolverInterface

Laravel :, (*12)

  • LaravelResolver

TranslatorInterface

Interface :, (*13)

  • TranslatorInterface

Laravel :, (*14)

  • LaravelTranslator

TODO

  • More integrations (Zf2, Symfony2...)
  • More doc
  • More examples

Enjoy it ! Feel free to fork :) !, (*15)

The Versions

20/08 2016

dev-master

9999999-dev

An extensible library to manage menus

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Thomas SIEFFERT

20/08 2016

2.0.0

2.0.0.0

An extensible library to manage menus

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Thomas SIEFFERT

15/08 2016

1.0.1

1.0.1.0

An extensible library to manage menus

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Thomas SIEFFERT

15/08 2016

1.0.0

1.0.0.0

An extensible library to manage menus

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

by Thomas SIEFFERT

19/01 2016

0.2

0.2.0.0

An extensible library to manage menus

  Sources   Download

The Requires

  • php >=5.4.0

 

by Thomas SIEFFERT

02/11 2015

0.1

0.1.0.0

An extensible library to manage menus

  Sources   Download

The Requires

  • php >=5.4.0

 

by Thomas SIEFFERT