无法使用Yii2 NavBar小部件生成预期的Html标记

时间:2015-09-19 07:09:11

标签: php yii2

使用Yii2的Bootstrap NavBar小部件。我想生成这个标记:

<!-- Navigation panel -->
<nav class="main-nav dark transparent stick-fixed">
  <div class="full-wrapper relative clearfix">
    <!-- Logo ( * your text or image into link tag *) -->
    <div class="nav-logo-wrap local-scroll">
      <a href="#top" class="logo">
        <img src="images/logo-white.png" alt="" />
      </a>
    </div>
    <div class="mobile-nav">
      <i class="fa fa-bars"></i>
    </div>
    <!-- Main Menu -->
    <div class="inner-nav desktop-nav">
      <ul class="clearlist scroll-nav local-scroll">
        <li class="active"><a href="#home">Home</a></li>
        <li><a href="#about">About</a></li>
        <li>
          <a href="#" class="mn-has-sub">Eng <i class="fa fa-angle-down"></i</a
          <ul class="mn-sub">
              <li><a href="">English</a></li>
              <li><a href="">France</a></li>
              <li><a href="">Germany</a></li>
         </ul>
        </li>
      </ul>
    </div>
  </div>
</nav>
<!-- End Navigation panel -->

这是我的NavBar小部件,如下所示:

<?php NavBar::begin([
    'options' => ['class' => ' main-nav dark transparent stick-fixed'],
    'innerContainerOptions' => ['class' => ' full-wrapper relative clearfix'],
    'brandOptions' => ['class' => 'logo'],
    'brandLabel' => '<img src="/images/logo-white.png" alt=""/>',
    'brandUrl' => "/"]);
?>
<div class="mobile-nav">
   <i class="fa fa-bars"></i>
</div>
<div class="inner-nav desktop-nav">
   Language dropdown
   <?php
   echo Nav::widget([
       'encodeLabels' => false,
       'options' => ['class' => 'clearlist scroll-nav local-scroll'],
       'items' => [
           [
               'label' => Yii::$app->language,
               'items' => $availableLangs
           ]
       ]
   ]);

   NavBar::end();
   ?>
</div>

我的错在哪里?

0 个答案:

没有答案