A collapsible side navigation menu built to seamlessly work with Bootstrap framework

Overview

yii2-widget-sidenav

Latest Stable Version License Total Downloads Monthly Downloads Daily Downloads

This widget is a collapsible side navigation menu built to seamlessly work with Bootstrap framework. It is built over Bootstrap stacked nav component. This widget class extends the Yii Menu widget. Upto 3 levels of submenus are by default supported by the CSS styles to balance performance and useability. You can choose to extend it to more or less levels by customizing the CSS.

NOTE: This extension is a sub repo split of yii2-widgets. The split has been done since 08-Nov-2014 to allow developers to install this specific widget in isolation if needed. One can also use the extension the previous way with the whole suite of yii2-widgets.

Installation

The preferred way to install this extension is through composer. 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.

To install, either run

$ php composer.phar require kartik-v/yii2-widget-sidenav "*"

or add

"kartik-v/yii2-widget-sidenav": "*"

to the require section of your composer.json file.

Refer the CHANGE LOG for details.

Demo

You can refer detailed documentation and demos on usage of the extension.

Usage

use kartik\sidenav\SideNav;
     
echo SideNav::widget([
	'type' => SideNav::TYPE_SECONDARY,
	'heading' => 'Options',
	'items' => [
		[
			'url' => '#',
			'label' => 'Home',
			'icon' => 'home'
		],
		[
			'label' => 'Help',
			'icon' => 'question-sign',
			'items' => [
				['label' => 'About', 'icon'=>'info-sign', 'url'=>'#'],
				['label' => 'Contact', 'icon'=>'phone', 'url'=>'#'],
			],
		],
	],
]);

License

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

Comments
  • What is $item?

    What is $item?

    What is $item in below code? It continue throw me error undefined Variable $item, still I have metioned my link init.

    'active' => ($item == 'useradmin/index')]

    opened by willGreg 7
  • The link template options cannot be overwritten

    The link template options cannot be overwritten

    Hi, i am trying to add data-pjax="0" to the link, could you fix this error? Thank you


    Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

    bug 
    opened by robert589 4
  • Make it work with Bootstrap 4

    Make it work with Bootstrap 4

    Would it be possible to make this widget work with bootstrap 4? I couldn't find any alternative to this that works with it, and it would be awesome. Thanks in advance!

    enhancement 
    opened by trombipeti 1
  • Demo Site not working

    Demo Site not working

    The demo site link given in the docs http://demosbs3.krajee.com/widget-details/sidenav is not working image


    Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

    bug 
    opened by buttflattery 1
  • Illegal string offset at $item['top'] in function MarkTopItems

    Illegal string offset at $item['top'] in function MarkTopItems

    PHP 7.1 is not forgiving when assigning an element with a string offset to a variable which was not declared as an array. Therefore my sidenav menus break at the line $item['top'] = true; in SideNav.php. This can easily be remedied by first declaring $item = array(); after the check that $item['items'] is empty. I have now changed vendor/kartik-v/yii2-widgets-sidenav/SideNav.php myself, which obviously is not a wise thing to do.

    The code would look like as follows:

    protected function markTopItems() { $items = []; foreach ($this->items as $item) { if (empty($item['items'])) { $item = []; $item['top'] = TRUE; } $items[] = $item; } $this->items = $items; }

    wontfix 
    opened by ynzejan 1
  • css config

    css config

    Please display the css for the example of this component, when trying to reproduce the example of your page, it presents the menu to the right margin.

    Grateful

    wontfix 
    opened by fernandomorse 1
  • Not installed after running composer update

    Not installed after running composer update

    Hi all,

    I've installed this extension via composer by adding "kartik-v/yii2-widget-sidenav": "*" to the "require" section of composer.js.

    When I run composer show -i I can see the package is installed but it does not apper under vendor directory in my yii2 advance application.

    Can any one please let me know how to uninstall the extension and how to set the installation again?

    Thanks in advance.

    Alejandro.

    wontfix 
    opened by alejofonseca 1
Releases(v1.0.1)
Owner
Kartik Visweswaran
Kartik Visweswaran
Framework for building extensible server-side progressive applications for modern PHP.

Chevere ?? Subscribe to the newsletter to don't miss any update regarding Chevere. Framework for building extensible server-side progressive applicati

Chevere 65 Jan 6, 2023
Laravel 5 nested category/menu generator

Laravel 5 Nestable Laravel Nestable to work with recursive logic. Category level there is no limit but this may vary depending on your server performa

Ahmet 217 Nov 15, 2022
Extends Yii Menu widget

Extends Yii Menu widget. This widget offers a scrollspy and affixed enhanced navigation (upto 2-levels) to highlight sections and secondary sections in each page.

Kartik Visweswaran 15 Mar 12, 2022
A server side alternative implementation of socket.io in PHP based on workerman.

phpsocket.io A server side alternative implementation of socket.io in PHP based on Workerman. Notice Only support socket.io v1.3.0 or greater. This pr

walkor 2.1k Jan 6, 2023
Date/Time Picker widget for Yii2 framework Based on Eonasdan's Bootstrap 3 Date/Time Picker

Yii2 Date/Time Picker Widget Date/Time Picker widget for Yii2 framework Based on Eonasdan's Bootstrap 3 Date/Time Picker Demo Since this is a part of

Yevhen Terentiev 8 Mar 14, 2022
Fast php framework written in c, built in php extension

Yaf - Yet Another Framework PHP framework written in c and built as a PHP extension. Requirement PHP 7.0+ (master branch)) PHP 5.2+ (php5 branch) Inst

Xinchen Hui 4.5k Dec 28, 2022
This JSON marshaller is based on the one built into FEAST framework

Standalone JSON marshaller based off the one built into FEAST framework at feast/framework on packagist or feastframework/framework on github

null 13 Dec 9, 2022
PIP is a tiny application framework built for people who use a LAMP stack.

PIP is a tiny application framework built for people who use a LAMP stack. PIP aims to be as simple as possible to set up and use.

Ron Marasigan 244 Dec 30, 2022
Symprowire is a PHP MVC Framework based and built on Symfony, using the ProcessWire CMS as DBAL and Service Provider.

Symprowire - PHP MVC Framework for ProcessWire 3.x Symprowire is a PHP MVC Framework based and built on Symfony using ProcessWire 3.x as DBAL and Serv

Luis Mendez 7 Jan 16, 2022
A Slim PHP MVC framework built just for fun!

Aura Framework A Slim PHP MVC framework built just for fun! en: Note: This repository only contains the core code of the Aura framework. If you want t

Murilo Magalhães Barreto 2 Dec 16, 2021
Slim Framework view helper built on top of the Twig templating component

Slim Framework Twig View This is a Slim Framework view helper built on top of the Twig templating component. You can use this component to create and

Slim Framework 321 Dec 16, 2022
Coole is a PHP framework built on open source components

Coole is a PHP framework built on open source components. - Coole 是一个基于开源组件包构建的 PHP 框架。

guanguans 20 Jan 7, 2023
Easy integration of twitters bootstrap into symfony2

MopaBootstrapBundle MopaBootstrapBundle is a collection of code to integrate twitter's bootstrap (http://twitter.github.com/bootstrap/) as easy as pos

Philipp A. Mohrenweiser 717 Dec 15, 2022
Yii 2 Bootstrap 5 Extension

Twitter Bootstrap 5 Extension for Yii 2 This is the Twitter Bootstrap extension for Yii framework 2.0. It encapsulates Bootstrap 5 components and plug

Yii Software 48 Dec 14, 2022
yii2-app-advanced with Twitter Bootstrap 5

Yii 2 Advanced Project Template is a skeleton Yii 2 application best for developing complex Web applications with multiple tiers.

Nedarta 1 Nov 5, 2021
The package contains a bootstrap for running Yii3 web application.

Yii Web Runner The package contains a bootstrap for running Yii3 web application. Requirements PHP 8.0 or higher. Installation The package could be in

Yii Software 4 Oct 15, 2022
An enhanced FileInput widget for Bootstrap 4.x/3.x with file preview, multiple selection, and more features (sub repo split from yii2-widgets)

yii2-widget-fileinput The FileInput widget is a customized file input widget based on Krajee's Bootstrap FileInput JQuery Plugin. The widget enhances

Kartik Visweswaran 227 Nov 6, 2022
An extended bootstrap alert and alert block widget for Yii2 (sub repo split from yii2-widgets)

yii2-widget-alert This extension contains a couple of useful widgets. The Alert widget extends the \yii\bootstrap\Alert widget with more easy styling

Kartik Visweswaran 28 Mar 12, 2022
Javascript Minifier built in PHP

JShrink JShrink is a php class that minifies javascript so that it can be delivered to the client quicker. This code can be used by any product lookin

Robert Hafner 25 Oct 8, 2022