PHPackages                             extpoint/yii2-megamenu - 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. extpoint/yii2-megamenu

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

extpoint/yii2-megamenu
======================

Configurable site map with auto generate page title, breadcrumbs and navigation

1.7.0(7y ago)3310.9k—0%5MITPHPPHP &gt;=5.4.0

Since May 22Pushed 7y ago7 watchersCompare

[ Source](https://github.com/extpoint/yii2-megamenu)[ Packagist](https://packagist.org/packages/extpoint/yii2-megamenu)[ RSS](/packages/extpoint-yii2-megamenu/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (32)Used By (0)

yii2-megamenu
=============

[](#yii2-megamenu)

Configurable site map with auto generate page title, breadcrumbs and navigation.

Install
-------

[](#install)

Install by composer:

```
$ composer require ExtPoint/yii2-megamenu
```

After install, add MegaMenu to configuration:

```
...
'bootstrap' => ['log', 'megamenu'],
...
```

```
'components' => [
    'megaMenu'=> [
        'class' => '\extpoint\megamenu\MegaMenu',
        'items' => [
            // sitemap
        ],
    ],
    ...
],
```

Features
--------

[](#features)

- Auto generate page title, breadcrumbs, menus and navigation from site map configuration;
- Auto check access for actions (not implemented now) and menu item visible;
- Separate rules from UrlManager to modules.

API of component `\extpoint\megamenu\MegaMenu`
----------------------------------------------

[](#api-of-component-extpointmegamenumegamenu)

- `setItems(array $items)` Add menu items to end of list;
- `addItems()` Add tree menu items;
- `getItems()` Get all tree menu items;
- `getActiveItem()` Returned item with current route and parsed params. Alias `\Yii::$app->requestedRoute`, but also have params;
- `getMenu($fromItem = null, $custom = null)` Recursive find menu item by param $item (set null for return root) and return tree menu items (in format for `\yii\bootstrap\Nav::items`). Set param $custom as integer for limit tree levels. For example, `getMenu(null, 2)` return two-level menu;
- `getTitle($url = null)` Find item by url (ot current page) label and return it;
- `getFullTitle($url = null, $separator = ' — ')` Find item by url (or current page) and return item label with all parent labels;
- `getBreadcrumbs($url = null)` Return breadcrumbs links for widget `\yii\widgets\Breadcrumbs`;
- `getItem($item, &$parents = [])` Find menu item by item url or route. In param $parents will be added all parent items;
- `getItemUrl($item)` Find item by url or route and return it url.

API of Menu Item (class `\extpoint\megamenu\MegaMenuItem`)
----------------------------------------------------------

[](#api-of-menu-item-class-extpointmegamenumegamenuitem)

Menu item looks like to item from `\yii\bootstrap\Nav::items`. Next properties is identical:

- label
- url
- visible
- encode
- items
- linkOptions
- active

Additional properties:

- urlRule (string, array or `\yii\rest\UrlRule` instance) Value format is identical to item from `\yii\web\UrlManager::rules`;
- roles (string or array of strings) Value format is identical to `\yii\filters\AccessRule::roles`. `"?"`, `"@"` and string role are supported.
- order (integer or float) Each menu items sorted by `order` param. Default is zero.
- redirectToChild (boolean, string or integer) Set true or child item id for use link from this item.

How does item search
--------------------

[](#how-does-item-search)

Each items will be equals with search item (or url/route) by method `\extpoint\megamenu\MegaMenu::isUrlEquals`. Links are equals as two strings. Routes are equals will be normalized to full route (with controller and module), then routes equals as strings. If routes is equals, then checked url params (if it exists). If param value is null, then compared only it keys. If param value is not null, then compared keys and params values.

Examples:

```
isUrlEquals('http://google.com', 'http://google.com') // true
isUrlEquals(['/qq/ww/ee'], ['/aa/bb/cc']) // false
isUrlEquals(['/aa/bb/cc', 'foo' => null], ['/aa/bb/cc']) // false
isUrlEquals(['/aa/bb/cc', 'foo' => null], ['/aa/bb/cc', 'foo' => null]) // true
isUrlEquals(['/aa/bb/cc', 'foo' => 'qwe'], ['/aa/bb/cc', 'foo' => null]) // true
isUrlEquals(['/aa/bb/cc', 'foo' => 'qwe'], ['/aa/bb/cc', 'foo' => '555']) // false
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 76.7% 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 ~26 days

Recently: every ~51 days

Total

31

Last Release

2860d ago

### Community

Maintainers

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

---

Top Contributors

[![affka](https://avatars.githubusercontent.com/u/2149317?v=4)](https://github.com/affka "affka (33 commits)")[![perlexed](https://avatars.githubusercontent.com/u/1930759?v=4)](https://github.com/perlexed "perlexed (5 commits)")[![damirka](https://avatars.githubusercontent.com/u/8008055?v=4)](https://github.com/damirka "damirka (3 commits)")[![rumours86](https://avatars.githubusercontent.com/u/661490?v=4)](https://github.com/rumours86 "rumours86 (2 commits)")

---

Tags

menuyii2navigationbreadcrumbs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/extpoint-yii2-megamenu/health.svg)

```
[![Health](https://phpackages.com/badges/extpoint-yii2-megamenu/health.svg)](https://phpackages.com/packages/extpoint-yii2-megamenu)
```

###  Alternatives

[kartik-v/yii2-widget-sidenav

An enhanced side navigation menu styled for bootstrap (sub repo split from yii2-widgets)

364.0M8](/packages/kartik-v-yii2-widget-sidenav)[geeklabs/ci4-breadcrumbs

Breadcrumb navigation for CodeIgniter 4

2813.5k](/packages/geeklabs-ci4-breadcrumbs)

PHPackages © 2026

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