I have a navigation header as follows:
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="container-fluid"> <div class="navbar-collapse collapse"> <form class="navbar-form navbar-right" role="search"> <div class="form-group has-feedback"> <input id="searchbox" type="text" placeholder="Search" class="form-control"> <span id="searchicon" class="fa fa-search form-control-feedback"></span> </div> </form> </div> </div> </div>
I have a problem when I want to convert this code using yii\bootstrap\NavBar; :
<div class="navbar-collapse collapse"> <form class="navbar-form navbar-right" role="search"> <div class="form-group has-feedback"> <input id="searchbox" type="text" placeholder="Search" class="form-control"> <span id="searchicon" class="fa fa-search form-control-feedback"></span> </div> </form> </div>
And this is the code of my Layout using yii\bootstrap\NavBar; :
<?php NavBar::begin([ 'brandLabel' => 'My Company', 'brandUrl' => Yii::$app->homeUrl, 'options' => [ 'class' => 'navbar navbar-inverse navbar-fixed-top', 'role' => 'navigation', ], ]); NavBar::end(); ?>
I read the Navbar Widget , but still do not understand. Can anyone teach me how to use the Navbar widget on the Yii2 framework ?
source share