navbar - Font Awesome use inside the Yii2 SideNavbar -
i have followed guidelines given github yii2 fontawesome , installed via composer. problem code given specific icon sidenavbar not working me.
i have used fa::icon('home') inside sidenav menu code out put "> this. not home icon.
code used in sidenav menu.
<?= sidenav::widget([ 'type' => sidenav::type_default, 'heading' => 'system functions', 'items' => [ [ 'url' => '../dashboard/manager', 'label' => yii::t('app','dashboard'), 'icon' => 'home', 'active' => ($currentpage == 'manager') ], [ 'url' => '#', 'label' => 'purchase', 'icon' => fa::icon('home'), 'items' => [ [ 'url' => '../dashboard/suppliers', 'label' => yii::t('app','suppliers'), 'icon'=>'transport', 'active' => ($currentpage == 'suppliers') ], [ 'url' => '../dashboard/leaf-entry', 'label' => 'leaf collection', 'icon'=>'leaf', 'active' => ($currentpage == 'leaf') ], [ 'url' => '../dashboard/payments', 'label' => 'payments', 'icon'=>'phone', 'active'=> ($currentpage == 'payments') ], ['label' => 'reports', 'icon'=>'phone', 'url'=>'#'] ], ], [ 'label' => 'stock', 'icon' => 'question-sign', 'items' => [ ['label' => 'live stock', 'icon'=>'info-sign', 'url'=>'#'], ['label' => 'auction despatch', 'icon'=>'phone', 'url'=>'#'], ['label' => 'production tracker', 'icon'=>'phone', 'url'=>'#'], ['label' => 'reports', 'icon'=>'phone', 'url'=>'#'] ], ], [ 'label' => 'human resource', 'icon' => 'question-sign', 'items' => [ ['label' => 'employees', 'icon'=>'info-sign', 'url'=>'#'], ['label' => 'time tracker', 'icon'=>'phone', 'url'=>'#'], ['label' => 'payments', 'icon'=>'phone', 'url'=>'#'], ['label' => 'reports', 'icon'=>'phone', 'url'=>'#'] ], ], [ 'label' => 'end of day calculations', 'icon' => 'question-sign', 'items' => [ ['label' => 'water basis', 'icon'=>'info-sign', 'url'=>'#'], ['label' => 'dry basis', 'icon'=>'phone', 'url'=>'#'], ['label' => 'out turn', 'icon'=>'phone', 'url'=>'#'], ['label' => 'refuced tea', 'icon'=>'phone', 'url'=>'#'] ], ], ], ]); ?>
output
and have used chrome devtools inspect element, gives me below result. hope problem.
you using sidenav::widget
, uses default icon prefix "glyphicon glyphicon-"
. sidenav property. if creating sidenav using glyphicon
icon, use glyphicon
icons. if want use font awesome icons, need change icon prefix this:
echo sidenav::widget([ 'type' => sidenav::type_default, 'heading' => 'system functions', 'iconprefix' => ' ', 'items' => [ [ 'url' => '#', 'label' => 'home', 'icon' => 'fa fa-home', ] ] ]);
you can use 1 type of icons @ time.
Comments
Post a Comment