kartik-v/yii2-nav-x An extended bootstrap Nav widget for Yii 2 with submenu drilldown.

extensionwidgetmenucontextmouseclick

Krajee Logo
yii2-nav-x Donate       kartikv

[![Stable Version](https://poser.pugx.org/kartik-v/yii2-nav-x/v/stable)](https://packagist.org/packages/kartik-v/yii2-nav-x) [![Unstable Version](https://poser.pugx.org/kartik-v/yii2-nav-x/v/unstable)](https://packagist.org/packages/kartik-v/yii2-nav-x) [![License](https://poser.pugx.org/kartik-v/yii2-nav-x/license)](https://packagist.org/packages/kartik-v/yii2-nav-x) [![Total Downloads](https://poser.pugx.org/kartik-v/yii2-nav-x/downloads)](https://packagist.org/packages/kartik-v/yii2-nav-x) [![Monthly Downloads](https://poser.pugx.org/kartik-v/yii2-nav-x/d/monthly)](https://packagist.org/packages/kartik-v/yii2-nav-x) [![Daily Downloads](https://poser.pugx.org/kartik-v/yii2-nav-x/d/daily)](https://packagist.org/packages/kartik-v/yii2-nav-x)

An extended bootstrap Nav widget for Yii Framework 2 with submenu drilldown. This widget extends the \yii\bootstrap\Nav widget for Bootstrap 3.x and \yii\bootstrap4\Nav widget for Bootstrap 4.x \yii\bootstrap5\Nav widget for Bootstrap 5.x with some additional controls and adding the CSS Styles for enabling a submenu drilldown. The dropdown menu style is optimized for both desktop and mobile devices. The drilldown is triggered on active instead of hover so that it works equally well on mobile devices. The extension uses the one of the following Dropdown Class extensions by default for rendering dropdown navigation, but this can be overridden:

  • \kartik\dropdown\DropdownX for Bootstrap 3.x
  • \kartik\bs4dropdown\Dropdown for Bootstrap 4.x
  • \kartik\bs5dropdown\Dropdown for Bootstrap 5.x

Demo

You can see detailed documentation on usage of the extension.

Installation

Install the dependencies depending on the Bootstrap version used in your app:

  1. For Bootstrap 3.x install kartik-v/yii2-dropdown-x
$ php composer.phar require kartik-v/yii2-dropdown-x "@dev"
  1. For Bootstrap 4.x install kartik-v/yii2-bootstrap4-dropdown

    $ php composer.phar require kartik-v/yii2-bootstrap4-dropdown "@dev"
  2. For Bootstrap 5.x install kartik-v/yii2-bootstrap5-dropdown

    $ php composer.phar require kartik-v/yii2-bootstrap5-dropdown "@dev"

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-nav-x "@dev"

or add

"kartik-v/yii2-nav-x": "@dev"

to the require section of your composer.json file.

Usage

NavX

use kartik\nav\NavX;
echo NavX::widget([
    'options' => ['class' => 'nav nav-pills'],
    'items' => [
        ['label' => 'Action', 'url' => '#'],
        ['label' => 'Submenu', 'items' => [
            ['label' => 'Action', 'url' => '#'],
            ['label' => 'Another action', 'url' => '#'],
            ['label' => 'Something else here', 'url' => '#'],
        ]],
        ['label' => 'Something else here', 'url' => '#'],
        '<li class="divider"></li>',
        ['label' => 'Separated link', 'url' => '#'],
    ],
    'encodeLabels' => false
]);

License

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

Changelog

Change Log: yii2-nav-x

Version 1.2.6

Date: 24-Jan-2022

Version 1.2.5

Date: 02-Nov-2021

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

Version 1.2.4

Date: 19-Sep-2018

  • Maintain dependency on kartik-v/yii2-dropdown-x for Backward compatibility.

Version 1.2.3

Date: 19-Sep-2018

  • Correct README for dependencies.

Version 1.2.2

Date: 19-Sep-2018

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

Version 1.2.1

Date: 13-May-2017

  • Chronological ordering of issues for change log.
  • Add github contribution and PR templates.
  • (enh #14, #15, #16): Better styling for submenu items for smaller device screens.
  • Add branch alias for dev-master latest release.
  • (enh #12): Refactor NavX code based on latest yii\bootstrap\Nav.

Version 1.2.0

Date: 07-Dec-2014

  • (enh #7): Enhance multi level navigation beyond 2 levels.

Version 1.1.0

Date: 08-Nov-2014

  • Set release to stable
  • Enhance dependency validation using common code base.

Version 1.0.0

Date: 08-May-2014

  • PSR4 alias change
  • (bug #6): Enhance the extension to have the right dependency on yii\bootstrap assets.
  • Initial release

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



v1.2.5 is the latest of 8 releases



BSD-3-Clause license
Stats
28 github stars & 3 github forks
134 downloads in the last day
5623 downloads in the last 30 days
423932 total downloads