PHPackages                             igdr/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. igdr/config-knp-menu-bundle

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

igdr/config-knp-menu-bundle
===========================

Configure your knp menus with yaml files accross your project bundles

02.4k1PHP

Since Jan 26Pushed 9y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

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

[](#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)

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": {
        "igdr/config-knp-menu-bundle": "dev-master"
    }
}

```

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

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

```

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

```

Then you need to define a service.

```
my_project.menu.admin:
    class: Knp\Menu\MenuItem
    factory_service: igdr_config_menu.menu.builder
    factory_method: createMenu
    arguments:
      - "@request"
      - "my_mega_menu"
    scope: request
    tags:
        - { name: knp_menu.menu, alias: my_menu }

```

The second argument must match the name of the menu in navigation.yml. The tag alias will be used in your twig template.

```
{{ knp_menu_render('my_menu') }}

```

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

[](#configuration)

This is the available configuration definition for an item.

```
my_mega_menu:
    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
            display: boolean to hide the item
            displayChildren: boolean to hide the children
            children: # An array of subitems
                second_level_item:
                    label: My second level

```

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

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b43bdf609a0bbcb50ca6e968cd7a62159b63c2296c1151b937a87cf78f29890?d=identicon)[igdr](/maintainers/igdr)

---

Top Contributors

[![igdr](https://avatars.githubusercontent.com/u/4249152?v=4)](https://github.com/igdr "igdr (4 commits)")

### Embed Badge

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

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

###  Alternatives

[hyva-themes/magento2-graphql-tokens

Adds Customer and Cart tokens to CustomerData sections

242.9M2](/packages/hyva-themes-magento2-graphql-tokens)

PHPackages © 2026

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