找不到类'kartik \ widgets \ SideNav'

时间:2016-03-17 05:27:54

标签: yii2

我有错误类'kartik \ widgets \ SideNav'找不到我能做什么

我的main.php是

use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;
use host33\multilevelverticalmenu\MultilevelVerticalMenu;

use kartik\widgets\SideNav;

AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
  <html lang="<?= Yii::$app->language ?>">
 <head>
 <meta charset="<?= Yii::$app->charset ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?= Html::csrfMetaTags() ?>
<title><?= Html::encode($this->title) ?></title>
<?php $this->head() ?>
</head>
 <body>
 <?php $this->beginBody() ?>
  <?php
  echo SideNav::widget([
 'type' => SideNav::TYPE_PRIMARY,
 'heading' => 'Options',
  'items' => [
  [
      'url' => 'casual-leaves/index',
      'label' => 'Applications for casual leave',
      'icon' => 'home'
  ],
  [
      'label' => 'Help',
      'icon' => 'question-sign',
      'url'=> ['/site/index'],
      'items' => [
          ['label' => 'About', 'icon'=>'info-sign', 'url'=>['/site/contact']],
          ['label' => 'Contact', 'icon'=>'phone', 'url'=>['/site/contact']],
      ],
  ],
],

 ]);
 ?>


<div class="wrap">
 <?php
 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();
?>
<div class="container">
    <?= Breadcrumbs::widget([
        'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
    ]) ?>

    <?= $content ?>
</div>

<div class="container">
    <p class="pull-left">&copy; My Company <?= date('Y') ?></p>

    <p class="pull-right"><?= Yii::powered() ?></p>
</div>

 <?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>

我的作曲家是

 {
    "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",
    "kartik-v/yii2-widgets-sidenav":"*",
    //composer
    "warrence/yii2-kartikgii":"*",
    "kartik-v/yii2-nav-x": "*"
},
"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"
    }
}

}

我无法得到结果iam也使用kartic / sidenav / Sidenav但是找不到同样的错误

请帮助我能做什么

0 个答案:

没有答案