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

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

cyneek/yii2-menu
================

DataBase loader with menu items for Kartik Menu Widget.

21962PHP

Since Jul 19Pushed 10y ago3 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2 Menu Widget
================

[](#yii2-menu-widget)

Menu widget that loads Kartik sidenav widget with database items.

What's Menu Widget?
-------------------

[](#whats-menu-widget)

This widget gets from database a group of ordered and hierarchical items and loads them into the Kartik sidevan widget.

Developed by Joseba Juániz ([@Patroklo](http://twitter.com/Patroklo))

Minimum requirements
--------------------

[](#minimum-requirements)

- Yii2
- Php 5.4 or above

Future plans
------------

[](#future-plans)

- None right now.

License
-------

[](#license)

This is free software. It is released under the terms of the following BSD License.

Copyright (c) 2014, by Cyneek All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of Cyneek nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Instalation
-----------

[](#instalation)

- Install [Yii 2](http://www.yiiframework.com/download)
- Install package via [composer](http://getcomposer.org/download/)

    ```
      "cyneek/yii2-menu": "dev-master"

    ```
- Launch the migration

    ```
       php yii migrate --migrationPath=@vendor/cyneek/yii2-menu/migrations

    ```
- Profit!

Widget definition
-----------------

[](#widget-definition)

The first step is to fill the menu table with a menu structure. This can be achieved with the built-in methods of the MenuItems ActiveRecord:

### add\_menu\_item

[](#add_menu_item)

- label (String) (obligatory)

> Defines the text that will be shown for this menu item in the SideNav Widget.

- url (String) (optional)

> The url where the menu item will link in the sidenav.

- parent (String) (optional)

> Name of the parent menu item. This will create a hierarchical menu.

- name (String) (optional)

> Name of the menu item, if not defined, will use the label text.

- icon (String) (optional)

> CSS Bootstrap icon name that will be shown next to the menu item text.

- options (String) (optional)

> HTML Options that will be added into the menu item.

- visible (String) (optional)

> If 0, the menu item and all its children won't be shown at the sidenav.

### delete\_menu\_item

[](#delete_menu_item)

Warning: It deletes the menu item and all its children.

- name (String) (obligatory)

> Name of the menu item, that will be deleted.

### hide\_menu\_item

[](#hide_menu_item)

Warning: This will hide the menu item and all its children.

- name (String) (obligatory)

### show\_menu\_item

[](#show_menu_item)

- name (String) (obligatory)

Widget use
----------

[](#widget-use)

```
    echo \cyneek\yii2\menu\Menu::widget($options);

```

Options is an array as defined in the [Kartik Sidenav Widget Options](http://demos.krajee.com/widget-details/sidenav#sidenav-options).

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

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/ad71f0a9621c210395ea582f554e197f02f26c087e48aa5b3b464266b6efef59?d=identicon)[Patroklo](/maintainers/Patroklo)

---

Top Contributors

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

### Embed Badge

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

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

PHPackages © 2026

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