PHPackages                             disjfa/menu-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. disjfa/menu-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

disjfa/menu-bundle
==================

Menu bundle for symfony, can also be use in glynn-admin-symfony

0.6.0(6mo ago)11.4k1MITPHP

Since Oct 11Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/disjfa/menu-bundle)[ Packagist](https://packagist.org/packages/disjfa/menu-bundle)[ RSS](/packages/disjfa-menu-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (2)Versions (9)Used By (1)

Menu bundle
===========

[](#menu-bundle)

[![Check on packagist](https://camo.githubusercontent.com/7b328737f9b72cfcfeaea9ee1c581a1a7f6db4287c9a3d76b563d36a7b9e74d2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6469736a66612f6d656e752d62756e646c65)](https://packagist.org/packages/disjfa/menu-bundle)[![MIT License](https://camo.githubusercontent.com/0d6f90ee497d123d19e02c0b91965bdc79da17da4dd08a1066b8a21ed2cb7076/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6469736a66612f6d656e752d62756e646c652e737667)](https://github.com/disjfa/menu-bundle/blob/master/LICENSE)

[![Watch on GitHub](https://camo.githubusercontent.com/d186b2d4a7446220309f828575fdb4afc77d53e66bf17a1f97a3856b7768b014/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f77617463686572732f6469736a66612f6d656e752d62756e646c652e7376673f7374796c653d736f6369616c)](https://github.com/disjfa/menu-bundle/watchers)[![Star on GitHub](https://camo.githubusercontent.com/66e829268d5c5a4ff169fb5806b589efab68809bc9d4c9fe0ef27337fc139cf3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6469736a66612f6d656e752d62756e646c652e7376673f7374796c653d736f6369616c)](https://github.com/disjfa/menu-bundle/stargazers)[![Tweet](https://camo.githubusercontent.com/eb3f6c7a768edb2ee2b172a220bf05495e7edd6d08ebb41b6c0c09a6e7ef2d58/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f75726c2f68747470732f6769746875622e636f6d2f6469736a66612f6d656e752d62756e646c652e7376673f7374796c653d736f6369616c)](https://twitter.com/intent/tweet?text=Check%20out%20menu-bundle!%20-%20Cool%mail%20setup%20for%20symfony!%20Thanks%20@disjfa%20https://github.com/disjfa/menu-bundle%20%F0%9F%A4%97)

### What does it do

[](#what-does-it-do)

This bundle adds two menu builders for your project. One for the site side, and one for the admin. This can help it to make live easier to generate menu structures. You can take a look at [glynn-admin-symfony4](https://github.com/disjfa/glynn-admin-symfony4) for a simple working example. It is using the [KnpMenuBundle](https://symfony.com/doc/master/bundles/KnpMenuBundle/index.html).

It is opinionated, it is setup using the bootstrap4 template

### Instalation

[](#instalation)

```
composer req disjfa/menu-bundle

```

Setup
-----

[](#setup)

In the template you have to add a menu.

```
{{ knp_menu_render('admin', {'currentClass': 'active', 'ancestorClass': 'active', 'depth':3, 'template': 'admin/menu.html.twig'}) }}
```

or

```
{{ knp_menu_render('site', {'currentClass': 'active', 'ancestorClass': 'active', 'depth':2, 'template': 'admin/menu.html.twig'}) }}
```

### Resister a menu

[](#resister-a-menu)

And then, in your code you can just subscribe to the menus to add your own

```
