yii2-context-menu A context menu for Yii Framework 2.0 styled for Bootstrap 3.

  1. Demo
  2. Requirements
  3. Installation
  4. Usage
  5. Report
  6. License
  7. Resources

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 Bootstrap 3. The widget uses the \yii\bootstrap\Dropdown widget to generate a dropdown menu.

Demo

You can see detailed documentation with examples on usage of the extension.

Requirements

  • Yii 2.0 (*)
  • PHP 5.4
  • Twitter Bootstrap 3.0

NOTE: This extension mandatorily requires Yii Framework 2.

Installation

The preferred way to install this extension is through composer.

Either run:

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

or add:

"kartik-v/yii2-context-menu": "*"

to the require section of your composer.json file.

Usage

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();

Report

License

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

Resources

1 2
41 followers
0 downloads
Yii Version: 2.0
License: BSD-2-Clause
Category: User Interface
Developed by: Kartik V
Created on: May 4, 2014
Last updated: 10 years ago

Related Extensions