2
iam使用yii2開發在線應用程序。我想在我的應用程序中使用側欄菜單。我如何創建?我只有導航欄菜單。我想在右側添加邊欄菜單。「我怎樣才能在右側使用yii2的邊欄菜單
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 for casual leave', 'url' => ['casual-leaves/index']],
['label' => 'Applications for Mtech leave', 'url' => ['mtech-leave/index']],
['label' => 'Applications for Phd leave', 'url' => ['phd-leave/index']],
['label' => 'Applications for 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();
?>
這是我的導航欄菜單。我能做些什麼來獲得側欄菜單。我想重新安排導航欄。那是我嘗試把所有的離開應用程序放入邊欄。
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"
}
}
}
這是正確的我只添加此行 「卡爾蒂克-V/yii2-窗口小部件」: 「DEV-主」 任何其他工藝進行安裝
我有一個錯誤類「卡爾蒂克\小工具\ SideNav」未找到 – anu
你安裝的擴展? ..有關此擴展的信息,請參閱鏈接 – scaisEdge
如何安裝擴展 – anu