This is a discussion forum for the yii2-icons extension. This extension offers an easy method to setup various icon frameworks to work with Yii Framework 2.0. Most popular and free icon frameworks available are currently supported. You can view demo and documentation of this extension here.
This is more a configuration at the Nav Widget level. Read the docs and code for Yii2 Bootstrap extension. The Yii2 Navbar uses Nav widget to generate menus. Note: The [font="Lucida Console"]kartik\icons\Icon::show[/font] will generate HTML code. So in your [font="Lucida Console"]Nav::widget[/font] you should use [font="Lucida Console"]encodeLabels => false[/font] to not Html encode icons in labels. For example:
$items = [
['label' => Icon::show('home') . 'Home', 'url' => ['/site/index']],
NavBar::begin(['brandLabel' => 'My Application']);
/* Note you must encodeLabels to false to display icons in labels */
'items' => $items,
'encodeLabels' => false
I’m getting started with Yii2 and cannot install your extension through Composer. It complains that the extension requires yiisoft/yii2:“dev-master” which isn’t found. I installed the Yii2 basic application with no problems and it uses yiisoft/yii2:"*", not dev-master. Please let me know how to proceed.
Not sure what you have missed. Cannot replicate at my end. I tested a fresh install of the basic app and then installed this extension and it works. After basic app install, I added [font="Courier New"]kartik-v/yii2-icons: dev-master[/font] to the require section of composer.json, and ran [font="Courier New"]composer update[/font] and the extension installs flawlessly. Can you check the composer settings, package cache, and see if something is amiss?