PHPackages                             firestorm23/config-knp-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. firestorm23/config-knp-menu-bundle

ActiveSymfony-bundle

firestorm23/config-knp-menu-bundle
==================================

Fork of jbouzekri/ConfigKnpMenuBundle

3.0.0(11y ago)017MITPHP

Since May 17Pushed 10y ago1 watchersCompare

[ Source](https://github.com/firestorm23/ConfigKnpMenuBundle)[ Packagist](https://packagist.org/packages/firestorm23/config-knp-menu-bundle)[ Docs](https://github.com/jbouzekri/ConfigKnpMenuBundle)[ RSS](/packages/firestorm23-config-knp-menu-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

ConfigKnpMenuBundle
===================

[](#configknpmenubundle)

[![Build Status](https://camo.githubusercontent.com/b0a33cca13612978da6bc2a85919f6c3054d4ee09238c322798d93b0b384448f/68747470733a2f2f7472617669732d63692e6f72672f6a626f757a656b72692f436f6e6669674b6e704d656e7542756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jbouzekri/ConfigKnpMenuBundle)

Introduction
------------

[](#introduction)

This bundle provides a way to configure your knp menus in your bundles yml configuration.

For more information on knp menu, read :

- The [Knp Menu Documentation](https://github.com/KnpLabs/KnpMenu/blob/master/README.markdown)
- The [Knp Menu Bundle Documentation](https://github.com/KnpLabs/KnpMenuBundle/blob/master/README.md)

This bundle was inspired by the [OroNavigationBundle](https://github.com/orocrm/platform/tree/master/src/Oro/Bundle/NavigationBundle) in oro crm.

Installation
------------

[](#installation)

You can use composer for installation.

Add the repository to the composer.json file of your project and run the update or install command.

```
{
    "require": {
        "jbouzekri/config-knp-menu-bundle": "3.0.0"
    }
}
```

Then enable it in your AppKernel.php with the KnpMenuBundle :

```
$bundles = array(
    ...
    new Knp\Bundle\MenuBundle\KnpMenuBundle(),
    new Jb\Bundle\ConfigKnpMenuBundle\JbConfigKnpMenuBundle(),
);
```

Documentation
-------------

[](#documentation)

In order to use this bundle, you must define your menu configuration in a **navigation.yml** file in your bundle.

Example :

```
my_mega_menu:
    tree:
        first_level_item:
            label: My first label
            children:
                second_level_item:
                    label: My second level
```

It will configure a provider for knp menu factory. You can then use your my\_mega\_menu in twig as a classic knp menu :

```
{{ knp_menu_render('my_mega_menu') }}
```

Configuration
-------------

[](#configuration)

This is the available configuration definition for an item.

```
my_mega_menu:
    childrenAttributes: An array of attributes passed to the root ul tag
    tree:
        first_level_item:
            uri: "An uri. Use it if you do not define route parameter"
            route: "A sf2 route without @"
            routeParameters: "an array of parameters to pass to the route"
            label: "My first label"
            order: An integer to sort the item in his level.
            attributes: An array of attributes passed to the knp item
            linkAttributes: An array of attributes passed to the a tag
            childrenAttributes: An array of attributes passed to the chidlren block
            labelAttributes: An array of attributes passed to the label tag
            display: boolean to hide the item
            displayChildren: boolean to hide the children
            roles: array of item (string roles) passed to isGranted securityContext method to check if user has rights in menu items
            children: # An array of subitems
                second_level_item:
                    label: My second level
```

This configuration matches the methods available in the Knp Menu Item class

Menu security
-------------

[](#menu-security)

Security context is injected in menu item provider.

For root menu item, display or hide it in your twig template. For children items, if you didn't add the roles key, they will be displayed. Else it will passed the array of key to the isGranted method and check if you have rights on the the item.

Issues
------

[](#issues)

- tree sub configuration property : In the navigation.yml file, you must defined a tree key below your menu name. It provides another level to keep the first level item key after configuration parsing. If someone know how to remove it, let me know.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 93.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~53 days

Total

4

Last Release

4215d ago

Major Versions

1.0.1 → 2.0.02014-08-20

2.0.0 → 3.0.02014-10-24

### Community

Maintainers

![](https://www.gravatar.com/avatar/d9259e6fa5cc940d10d4de0e771df8fa300158339eaef650ab8371b01aa252fb?d=identicon)[firestorm23](/maintainers/firestorm23)

---

Top Contributors

[![jbouzekri](https://avatars.githubusercontent.com/u/880996?v=4)](https://github.com/jbouzekri "jbouzekri (45 commits)")[![firestorm23](https://avatars.githubusercontent.com/u/9363520?v=4)](https://github.com/firestorm23 "firestorm23 (3 commits)")

---

Tags

symfonyknpuimenunavigationuser-interface

### Embed Badge

![Health badge](/badges/firestorm23-config-knp-menu-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/firestorm23-config-knp-menu-bundle/health.svg)](https://phpackages.com/packages/firestorm23-config-knp-menu-bundle)
```

###  Alternatives

[knplabs/knp-paginator-bundle

Paginator bundle for Symfony to automate pagination and simplify sorting and other features

1.8k42.8M314](/packages/knplabs-knp-paginator-bundle)[ao/translation-bundle

Doctrine as symfony translation provider + a nice gui for editing translations.

243.7k](/packages/ao-translation-bundle)[swiegmann/kirby-menu

This Kirby CMS-Plugin lets you build and render structured menues with a variety of features.

141.4k](/packages/swiegmann-kirby-menu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
