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\NavX
extension by default for rendering dropdown navigation, but this can be overridden.
Note: This extension depends on the kartik-v/yii2-widgets extension which in turn depends on the yiisoft/yii2-bootstrap extension. Check the composer.json for this extension's requirements and dependencies. Note: Yii 2 framework is still in active development, and until a fully stable Yii2 release, your core yii2-bootstrap packages (and its dependencies) may be updated when you install or update this extension. You may need to lock your composer package versions for your specific app, and test for extension break if you do not wish to auto update dependencies.
Demo ¶
You can see detailed documentation with examples on usage of the extension.
Requirements ¶
- Yii 2.0 (*)
- PHP 5.4
- 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-nav-x "*"
or add:
"kartik-v/yii2-nav-x": "*"
to the require
section of your composer.json
file.
Usage ¶
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
]);
Report ¶
- Report any issues on the project page
- Use the forum page for any discussions on this extension
License ¶
yii2-nav-x is released under the BSD 3-Clause License. See the bundled LICENSE.md
for details.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.