PHPackages                             icings/menu - 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. icings/menu

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

icings/menu
===========

A KnpMenu seasoned menu plugin for CakePHP.

5.0.0(2y ago)1266.4k—2.4%7[2 PRs](https://github.com/icings/menu/pulls)1MITPHPPHP &gt;=8.1CI failing

Since May 12Pushed 1y ago3 watchersCompare

[ Source](https://github.com/icings/menu)[ Packagist](https://packagist.org/packages/icings/menu)[ RSS](/packages/icings-menu/feed)WikiDiscussions 5.x Synced 1mo ago

READMEChangelog (3)Dependencies (4)Versions (29)Used By (1)

Menu
====

[](#menu)

[![Build Status](https://camo.githubusercontent.com/a731d2f8b005ac5ac09aad8a9f8e38344439c5bf11ced4e30683a4db8170c881/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6963696e67732f6d656e752f63692e796d6c3f6272616e63683d352e78267374796c653d666c61742d737175617265)](https://github.com/icings/menu/actions/workflows/ci.yml?query=branch%3A5.x)[![Coverage Status](https://camo.githubusercontent.com/b054519045121a776fb96d0d9698c0b4748ec3596131355520c058d7eb0e0aed/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6963696e67732f6d656e752f352e782e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/github/icings/menu/tree/5.x)[![Latest Version](https://camo.githubusercontent.com/b9255a09edcce92685289ec2e3bc46a9c541d719c482054b1bd9add6ffa6ad3b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6963696e67732f6d656e752e7376673f7374796c653d666c61742d737175617265266c6162656c3d6c6174657374)](https://packagist.org/packages/icings/menu)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.txt)

A [KnpMenu](https://github.com/KnpLabs/KnpMenu) seasoned plugin that assists with creating menus for your [CakePHP](https://cakephp.org) applications.

Requirements
------------

[](#requirements)

- CakePHP 5.0+ (use the [4.x branch](https://github.com/icings/menu/tree/4.x) of this plugin if you need CakePHP 4 compatibility)
- KnpMenu 3.3+

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

[](#installation)

1. Use [Composer](http://getcomposer.org) to add the menu plugin to your project:

    ```
    $ composer require icings/menu
    ```
2. Make sure that you are loading the plugin in your bootstrap, either run:

    ```
    $ bin/cake plugin load Icings/Menu
    ```

    or add the following call to your `Application` class' `bootstrap()` method in the `src/Application.php` file:

    ```
    $this->addPlugin('Icings/Menu');
    ```
3. Load the helper in your `AppView` class' `initialize()` method, located in the `src/View/AppView.php` file:

    ```
    $this->loadHelper('Icings/Menu.Menu');
    ```

Usage
-----

[](#usage)

Detailed usage documentation can be found in the [docs](docs/index.md) folder. For those that are familiar with CakePHP and KnpMenu, here's two examples for a quick start.

### Via the Menu helper

[](#via-the-menu-helper)

Build and render the menu via the helpers `create()` and `render()` methods:

```
$menu = $this->Menu->create('main');
$menu->addChild('Home', ['uri' => ['controller' => 'Pages', 'action' => 'display', 'home']]);
$menu->addChild('About', ['uri' => ['controller' => 'Pages', 'action' => 'display', 'about']]);

$menu->addChild('Services', ['uri' => '#']);
$menu['Services']->addChild('Research', ['uri' => ['controller' => 'Pages', 'action' => 'display', 'research']]);
$menu['Services']->addChild('Security', ['uri' => ['controller' => 'Pages', 'action' => 'display', 'security']]);

$menu->addChild('Contact', ['uri' => ['controller' => 'Pages', 'action' => 'display', 'contact']]);

echo $this->Menu->render();
```

In the default setup, this would generate the following HTML:

```

        Home

        About

        Services

                Research

                Security

        Contact

```

### Using the library directly

[](#using-the-library-directly)

Aside from using the menu helper and its various configuration possibilities, it's also possible to manually utilize the library provided by this plugin, optionally combining things with the KnpMenu library:

```
use Icings\Menu\Integration\PerItemVotersExtension;
use Icings\Menu\Integration\RoutingExtension;
use Icings\Menu\Integration\TemplaterExtension;
use Icings\Menu\Matcher\Matcher;
use Icings\Menu\Matcher\Voter\UrlVoter;
use Icings\Menu\MenuFactory;
use Icings\Menu\Renderer\StringTemplateRenderer;

$factory = new MenuFactory();
$factory->addExtension(new RoutingExtension());
$factory->addExtension(new PerItemVotersExtension());
$factory->addExtension(new TemplaterExtension());

$menu = $factory->createItem('main');
$menu->addChild('Home', ['uri' => ['controller' => 'Pages', 'action' => 'display', 'home']]);
$menu->addChild('About', ['uri' => ['controller' => 'Pages', 'action' => 'display', 'about']]);
$menu->addChild('Services', ['uri' => '#']);
$menu['Services']->addChild('Research', ['uri' => ['controller' => 'Pages', 'action' => 'display', 'research']]);
$menu['Services']->addChild('Security', ['uri' => ['controller' => 'Pages', 'action' => 'display', 'security']]);
$menu->addChild('Contact', ['uri' => ['controller' => 'Pages', 'action' => 'display', 'contact']]);

$matcher = new Matcher();
$matcher->addVoter(new UrlVoter($this->request));

$renderer = new StringTemplateRenderer($matcher);
echo $renderer->render($menu);
```

Issues
------

[](#issues)

Please use the [issue tracker](https://github.com/icings/menu/issues) to report problems.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 99% 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 ~92 days

Recently: every ~105 days

Total

29

Last Release

699d ago

Major Versions

3.0.1 → 4.0.0-RC12019-11-21

3.1.0 → 4.1.02020-06-06

3.x-dev → 4.1.12021-10-24

4.1.2 → 5.0.0-RC12023-08-02

4.x-dev → 5.0.02023-09-13

PHP version history (3 changes)1.0.0-beta1PHP &gt;=5.6.0

4.0.0-alpha1PHP &gt;=7.2.0

5.0.0-RC1PHP &gt;=8.1

### Community

Maintainers

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

---

Top Contributors

[![ndm2](https://avatars.githubusercontent.com/u/5031606?v=4)](https://github.com/ndm2 "ndm2 (101 commits)")[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (1 commits)")

---

Tags

cakephp-pluginknpmenumenuphpcakephpmenuknp-menu

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/icings-menu/health.svg)

```
[![Health](https://phpackages.com/badges/icings-menu/health.svg)](https://phpackages.com/packages/icings-menu)
```

###  Alternatives

[knplabs/knp-menu-bundle

This bundle provides an integration of the KnpMenu library

1.4k53.8M315](/packages/knplabs-knp-menu-bundle)[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

338920.1k32](/packages/dereuromark-cakephp-tools)[markstory/asset_compress

An asset compression plugin for CakePHP. Provides file concatenation and a flexible filter system for preprocessing and minification.

3761.0M11](/packages/markstory-asset-compress)[gourmet/knp-menu

KnpMenu for CakePHP 3

1450.7k3](/packages/gourmet-knp-menu)[dereuromark/cakephp-shim

A CakePHP plugin to shim applications between major framework versions.

401.0M11](/packages/dereuromark-cakephp-shim)[cakedc/tiny-mce

TinyMCE Plugin for CakePHP

10790.2k](/packages/cakedc-tiny-mce)

PHPackages © 2026

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