how can i put sidebar menu in right side using yii2 -


iam developing online application using yii2 . want use side bar menu in application. how can create ? have navigation bar menu. want sidebar menu in right side.`

  navbar::begin([     'brandlabel' => 'civil department',     'brandurl' => yii::$app->homeurl,     'options' => [         'class' => 'navbar-inverse navbar-fixed-top',     ], ]); echo nav::widget([     'options' => ['class' => 'navbar-nav navbar-right'],     'items' => [         ['label' => 'home', 'url' => ['/site/index']],         ['label' => 'about', 'url' => ['/site/about']],         ['label' => 'contact', 'url' => ['/site/contact']],      ['label' => 'applicationsforms', 'url' => ['/site/index'],  'items' => [              ['label' => 'casual leave', 'url' => ['casual-leaves/create']],             ['label' => 'mtech leave', 'url' => ['mtech-leave/create']],             ['label' => 'phd leave', 'url' => ['phd-leave/create']],             ['label' => 'duty leave', 'url' => ['duty-leave/create']],          ],'visible' => yii::$app->user->isguest // && yii::$app->user->identity->level == usertable::level1,     ],       ['label' => 'leave applications', 'url' => ['/site/index'],  'items' => [            ['label' => 'applications casual leave', 'url' => ['casual-leaves/index']],           ['label' => 'applications mtech leave', 'url' => ['mtech-leave/index']],           ['label' => 'applications phd leave', 'url' => ['phd-leave/index']],           ['label' => 'applications duty leave', 'url' => ['duty-leave/index']],        ],'visible' => !yii::$app->user->isguest // && yii::$app->user->identity->level == usertable::level1,   ],           yii::$app->user->isguest ?             ['label' => 'login', 'url' => ['/site/login']] :             [                 'label' => 'logout (' . yii::$app->user->identity->username . ')',                 'url' => ['/site/logout'],                 'linkoptions' => ['data-method' => 'post']             ],     ], ]); navbar::end(); ?> 

this navbar menu. can getting side bar menu. want re arrange navbar. try put leave application in sidebar .

composer.json

  "name": "yiisoft/yii2-app-basic", "description": "yii 2 basic project template", "keywords": ["yii2", "framework", "basic", "project template"], "homepage": "http://www.yiiframework.com/", "type": "project", "license": "bsd-3-clause", "support": {     "issues": "https://github.com/yiisoft/yii2/issues?state=open",     "forum": "http://www.yiiframework.com/forum/",     "wiki": "http://www.yiiframework.com/wiki/",     "irc": "irc://irc.freenode.net/yii",     "source": "https://github.com/yiisoft/yii2" }, "minimum-stability": "stable", "require": {     "php": ">=5.4.0",     "yiisoft/yii2": ">=2.0.5",     "yiisoft/yii2-bootstrap": "*",     "yiisoft/yii2-swiftmailer": "*",     "kartik-v/yii2-widgets": "dev-master" }, "require-dev": {     "yiisoft/yii2-codeception": "*",     "yiisoft/yii2-debug": "*",     "yiisoft/yii2-gii": "*",     "yiisoft/yii2-faker": "*",  }, "config": {     "process-timeout": 1800 }, "scripts": {     "post-create-project-cmd": [         "yii\\composer\\installer::postcreateproject"     ] }, "extra": {     "yii\\composer\\installer::postcreateproject": {         "setpermission": [             {                 "runtime": "0777",                 "web/assets": "0777",                 "yii": "0755"             }         ],         "generatecookievalidationkey": [             "config/web.php"         ]     },     "asset-installer-paths": {         "npm-asset-library": "vendor/npm",         "bower-asset-library": "vendor/bower"     } } 

}

is correct add line "kartik-v/yii2-widgets": "dev-master" other process installation

the simplest solution use extension : http://demos.krajee.com/widget-details/sidenav

for fixed sidenav can define proper layout or can add sidenav in page .. sample

use yii\helpers\url;  // class url ****** use kartik\widgets\sidenav;           $menuitems[] =  ['label' => 'dfenx - yii2 user - '. yii::t('app','user admin panel'),  'icon' => 'cog', 'url'=>url::to(['/user/admin/index'])];         $menuitems[] =  ['label' => yii::t('app','authentication manager'),  'icon' => 'th-list', 'items' =>  [                                 ['label' => 'settings', 'icon' => 'th-list', 'items' => [                                 ['label' => '/user/settings',  'url'=>url::to(['/user/settings'])],                                 ['label' => '/user/settings/profile', 'url'=>url::to(['/user/settings/profile'])],                                 ['label' => '/user/settings/account',  'url'=>url::to(['user/settings/account'])],                                 ['label' => '/user/settings/networks', 'url'=>url::to(['/user/settings/networks'])],                             ]],                             ['label' => 'registration', 'icon' => 'th-list', 'items' => [                                                                 ['label' => '/user/registration/register',  'url'=>url::to(['/user/registration/register'])],                                 ['label' => '/user/registration/resend',  'url'=>url::to(['/user/registration/resend'])],                             ]],                             ['label' => 'security', 'icon' => 'th-list', 'items' => [                                                                 ['label' => '/user/security/login', 'url'=>url::to(['/user/security/login'])],                                 ['label' => '/user/security/logout',  'url'=>url::to(['/user/security/logout'])],                             ]],                             ['label' => 'recovery', 'icon' => 'th-list', 'items'  => [                                                                ['label' => '/user/recovery/request',  'url'=>url::to(['/user/recovery/request'])],                                 ['label' => '/user/recovery/reset',  'url'=>url::to(['/user/recovery/reset'])],                              ]],                         ]];          $type = sidenav::type_primary;         $heading = '<i class="glyphicon glyphicon-user"></i> ' . yii::t('app','user admin - utilities');          echo sidenav::widget([             'type' => $type,             'encodelabels' => false,             'heading' => $heading,             'items' =>$menuitems,         ]); 

for installation see https://github.com/kartik-v/yii2-widgets or http://www.yiiframework.com/extension/yii2-widgets


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -