kartik-v/yii2-context-menu A context menu extension for Yii framework 2.0

extensionwidgetmenucontextmouseclick

Krajee Logo
yii2-context-menu Donate

Stable Version Unstable Version License Total Downloads Monthly Downloads Daily Downloads

A context menu extension for Yii framework 2.0 that allows you to add and render a context menu to any element on the page. A context menu is a pop up menu that one initiates on any element by right clicking the mouse in that target element. This widget is a wrapper for the bootstrap-contextmenu plugin which is styled for multiple Bootstrap versions (3.x, 4.x, and 5.x). The widget uses the \yii\bootstrap\Dropdown or \kartik\bs4dropdown\Dropdown widget to generate a dropdown menu.

Demo

You can see detailed documentation on usage of the extension.

Latest Release

Refer the CHANGE LOG for details on changes to various releases.

Installation

The preferred way to install this extension is through composer.

Note: Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki on setting the minimum-stability settings for your application's composer.json.

Either run

$ php composer.phar require kartik-v/yii2-context-menu "dev-master"

or add

"kartik-v/yii2-context-menu": "dev-master"

to the require section of your composer.json file.

Usage

ContextMenu

use kartik\cmenu\ContextMenu;
ContextMenu::begin([
    'items' => [
        ['label' => 'Action', 'url' => '#'],
        ['label' => 'Another action', 'url' => '#'],
        ['label' => 'Something else here', 'url' => '#'],
        '<li class="divider"></li>',
        ['label' => 'Separated link', 'url' => '#'],
    ],
]); 
// fill in any content within your target container
ContextMenu::end();

License

yii2-context-menu is released under the BSD-3-Clause License. See the bundled LICENSE.md for details.

Changelog

Change Log: yii2-context-menu

Version 1.2.4

Date: 01-Sep-2021

  • (enh #3): Enhancements to support Bootstrap v5.x.

Version 1.2.3

Date: 27-Mar-2020

  • Updates to support Bootstrap v4.x.
  • Move all source code to src directory.

Version 1.2.2

Date: 26-Nov-2016

  • Add github contribution and issue/PR logging templates.
  • Enhance PHP Documentation for all classes and methods in the extension.

Version 1.2.1

Date: 02-Jul-2016

  • Code formatting updates as per Yii2 coding style.
  • (enh #1, #2): Update to latest release of bootstrap-context-menu plugin.

Version 1.2.0

Date: 25-Nov-2014

  • Extend widget from krajee\base\Widget and use updated Krajee Base release v1.3.0

Version 1.1.0

Date: 10-Nov-2014

  • Set dependency on Krajee base component
  • Set release to stable

Version 1.0.0

Date: 01-Jul-2014

  • Initial release
  • PSR 4 alias change

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



v1.2.4 is the latest of 7 releases



BSD-3-Clause license
Stats
7 github stars & 5 github forks
167 downloads in the last day
3283 downloads in the last 30 days
120179 total downloads