Hy guys,
Can you someone pls give a advice how can I make a sidebar(left sidebar menu) in my app ? Do I have to change main.php in layouts of view or I am totaly uotside of solution ?
Thanks for any advice I want my own Sidebar, but I do not know how we can divide the page into two parts …
<div class="wrap">
<div id="sidebar">
</div>
<div id="content">
<?php
NavBar::begin([
'brandLabel' => 'App',
'brandUrl' => Yii::$app->homeUrl,
'options' => [
'class' => 'navbar-inverse navbar-fixed-top',
],
]);
echo Nav::widget([
'options' => ['class' => 'navbar-nav navbar-right'],
'items' => [
['label' => 'Feeds', 'url' => ['feed/index']],
['label' => 'Home', 'url' => ['/site/index']],
['label' => 'Contact', 'url' => ['/site/contact']],
Yii::$app->user->isGuest ? (
['label' => 'Login', 'url' => ['/site/login']]
) : (
'<li>'
. Html::beginForm(['/site/logout'], 'post')
. Html::submitButton(
'Logout (' . Yii::$app->user->identity->username . ')',
['class' => 'btn btn-link logout']
)
. Html::endForm()
. '</li>'
)
],
]);
NavBar::end();
?>
<div class="container">
<?= Breadcrumbs::widget([
'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]) ?>
<?= $content ?>
</div>
</div>
</div>
Can I start like this ? in main.php from views/layouts