yii2 如何生成bootstrap 左侧导航?
类似bootstrap中文官网文档,右侧的导航是如何生成的?样式
nav bs-docs-sidenav
http://v3.bootcss.com/components/#btn-dropdowns
截图:
yii2的main.php代码,如何填写:
<?php
use yii\helpers\Html;
use app\assets\AppAsset;
use yii\widgets\Breadcrumbs;
use yii\bootstrap\NavBar;
use yii\bootstrap\Nav;
/* @var $this \yii\web\View */
/* @var $content string */
AppAsset::register($this);
?>
<?php $this->beginPage()?>
<!DOCTYPE html>
<?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) ?>_后台_<?=Html::encode(Yii::$app->params['sitename'])?></title>
<?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>
<?php
NavBar::begin([
'brandLabel' => '<strong>' . Yii::$app->params['sitename'] . '</strong>',
'brandUrl' => Yii::$app->homeUrl,
'options' => [
'class' => 'navbar-default navbar-fixed-top',
'target' => '_blank',
],
]);
?>
<?php NavBar::end()?>
<?= Breadcrumbs::widget([
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]) ?>
<?= $content ?>
<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
DJLubel
10 years, 2 months ago