在adminiTE与yii2的集成中创建固定的导航栏和固定滚动的侧边栏
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在adminiTE与yii2的集成中创建固定的导航栏和固定滚动的侧边栏相关的知识,希望对你有一定的参考价值。
我使用yii和来自这个git, dmstr的adminLTE。
所以,我将布局从example-view的文件夹复制到我的视图/布局我的问题是
- 如何修复导航栏
- 侧边栏是固定的,但可以滚动?
这是我的代码:
导航栏
<?php
use yiihelpershtml;
/* @var $this yiiwebView */
/* @var $content string */
?>
<header class="main-header">
<?= Html::a('<span class="logo-mini">TMS</span><span class="logo-lg">' . Yii::$app->name . '</span>', Yii::$app->homeUrl, ['class' => 'logo']) ?>
<nav class="navbar navbar-static-top" role="navigation">
//Some element
</nav>
</header>
侧边栏
<aside class="main-sidebar">
<section class="sidebar">
<!-- Sidebar user panel -->
<div class="user-panel">
<div class="pull-left image">
<img src="<?= $directoryAsset ?>/img/user2-160x160.jpg" class="img-circle" alt="User Image"/>
</div>
<div class="pull-left info">
<p>Dzil Jalal</p>
<a href="#"><i class="fa fa-circle text-success"></i> Online</a>
</div>
</div>
<!-- search form -->
<form action="#" method="get" class="sidebar-form">
<div class="input-group">
<input type="text" name="q" class="form-control" placeholder="Search..."/>
<span class="input-group-btn">
<button type='submit' name='search' id='search-btn' class="btn btn-flat"><i class="fa fa-search"></i>
</button>
</span>
</div>
</form>
<!-- /.search form -->
<?=
dmstrwidgetsMenu::widget(
[
'options' => ['class' => 'sidebar-menu'],
'items' => [
['label' => 'Menu Yii2', 'options' => ['class' => 'header']],
['label' => 'Gii', 'icon' => 'fa fa-file-code-o', 'url' => ['/gii']],
['label' => 'Debug', 'icon' => 'fa fa-dashboard', 'url' => ['/debug']],
['label' => 'Login', 'url' => ['site/login'], 'visible' => Yii::$app->user->isGuest],
[
'label' => 'Same tools',
'icon' => 'fa fa-share',
'url' => '#',
'items' => [
['label' => 'Gii', 'icon' => 'fa fa-file-code-o', 'url' => ['/gii'],],
['label' => 'Debug', 'icon' => 'fa fa-dashboard', 'url' => ['/debug'],],
[
'label' => 'Level One',
'icon' => 'fa fa-circle-o',
'url' => '#',
'items' => [
['label' => 'Level Two', 'icon' => 'fa fa-circle-o', 'url' => '#',],
[
'label' => 'Level Two',
'icon' => 'fa fa-circle-o',
'url' => '#',
'items' => [
['label' => 'Level Three', 'icon' => 'fa fa-circle-o', 'url' => '#',],
['label' => 'Level Three', 'icon' => 'fa fa-circle-o', 'url' => '#',],
],
],
],
],
],
],
],
]
)
?>
</section>
</aside>
为了帮助,它非常感激
答案
为了使导航栏固定,请放置
class =“navbar navbar-fixed-top”
代替
class="navbar navbar-static-top"
以上是关于在adminiTE与yii2的集成中创建固定的导航栏和固定滚动的侧边栏的主要内容,如果未能解决你的问题,请参考以下文章