Extended bootstrap Nav widget with submenu option for Yii 2.
PHP CSS
Latest commit 394ef36 Jul 23, 2016 @kartik-v Update to release v1.2.1
Permalink
Failed to load latest commit information.
assets/css
CHANGE.md Update to release v1.2.1 Jul 23, 2016
LICENSE.md Updates to release v1.2.1 - fixes #12 May 1, 2016
NavX.php Updates to release v1.2.1 - fixes #12 May 1, 2016
NavXAsset.php
README.md
composer.json

README.md

yii2-nav-x

Stable Version Unstable Version License Total Downloads Monthly Downloads Daily Downloads

An extended bootstrap Nav widget for Yii Framework 2 with submenu drilldown. This widget extends the \yii\bootstrap\Nav widget 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 \kartik\dropdown\DropdownX extension by default for rendering dropdown navigation, but this can be overridden.

Demo

You can see detailed documentation on usage of the extension.

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

or add

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

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.