This is a complete demonstration of the SideNav widget by Krajee. Use the button options below to change the SideNav widget settings dynamically and check the impact on rendering.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum.
use kartik\widgets\SideNav; // OR if this package is installed separately, you can use // use kartik\sidenav\SideNav; use yii\helpers\Url; echo SideNav::widget([ 'type' => SideNav::TYPE_PRIMARY, 'encodeLabels' => false, 'heading' => false, 'items' => [ // Important: you need to specify url as 'controller/action', // not just as 'controller' even if default action is used. // // NOTE: The variable `$item` is specific to this demo page that determines // which menu item will be activated. You need to accordingly define and pass // such variables to your view object to handle such logic in your application // (to determine the active status). // ['label' => 'Home', 'icon' => 'home', 'url' => ['/site/home'], 'active' => false], ['label' => 'Books', 'icon' => 'book', 'items' => [ ['label' => '<span class="pull-right float-right float-end badge">10</span> New Arrivals', 'url' => ['/site/new-arrivals'], 'active' => false], ['label' => '<span class="pull-right float-right float-end badge">5</span> Most Popular', 'url' => ['/site/most-popular'], 'active' => false], ['label' => 'Read Online', 'icon' => 'cloud', 'items' => [ ['label' => 'Online 1', 'url' => ['/site/online-1'], 'active' => false)], ['label' => 'Online 2', 'url' => ['/site/online-2'], 'active' => false)] ]], ]], ['label' => '<span class="pull-right float-right float-end badge">3</span> Categories', 'icon' => 'tags', 'items' => [ ['label' => 'Fiction', 'url' => ['/site/fiction'], 'active' => false)], ['label' => 'Historical', 'url' => ['/site/historical'], 'active' => false)], ['label' => '<span class="pull-right float-right float-end badge">2</span> Announcements', 'icon' => 'bullhorn', 'items' => [ ['label' => 'Event 1', 'url' => ['/site/event-1'], 'active' => true)], ['label' => 'Event 2', 'url' => ['/site/event-2'], 'active' => false)] ]], ]], ['label' => 'Profile', 'icon' => 'user', 'url' => ['/site/profile'], 'active' => false)], ], ]);
Comments & Discussion
Note
You can now visit the Krajee Webtips Q & A forum for searching OR asking questions OR helping programmers with answers on these extensions and plugins. For asking a question click here. Select the appropriate question category (i.e. Krajee Plugins) and choose this current page plugin in the question related to field.
The comments and discussion section below are intended for generic discussions or feedback for this plugin. Developers may not be able to search or lookup here specific questions or tips on usage for this plugin.