cinghie / yii2-iconpicker
Yii2 Widget wrapper for bootstrap-iconpicker plugin http://victor-valencia.github.io/bootstrap-iconpicker/
Installs: 1 602
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 9
Type:yii2-extension
Requires
- bower-asset/eliberty-bootstrap-iconpicker: 1.8.1
- yiisoft/yii2: *
- yiisoft/yii2-bootstrap: *
This package is auto-updated.
Last update: 2024-12-08 12:05:59 UTC
README
Widget for bootstrap-iconpicker plugin http://victor-valencia.github.io/bootstrap-iconpicker/
Now based on more actual fork https://github.com/eliberty/bootstrap-iconpicker
Forked from https://github.com/Insolita/yii2-iconpicker
Installation
The preferred way to install this extension is through composer.
Either run
composer require --prefer-dist cinghie/yii2-iconpicker "^3.0.1"
or add
"cinghie/yii2-iconpicker": "^3.0.1"
to the require section of your composer.json
file.
Requirements
This extension require twitter-bootstrap > 3.0
You can use it for:
- glyphicon (with bootstrap)
- ionicon https://packagist.org/packages/rmrevin/yii2-ionicon
- fontawesome https://packagist.org/packages/rmrevin/yii2-fontawesome
- weathericon https://github.com/erikflowers/weather-icons
- mapicon
- octicon https://github.com/github/octicons
- typicon https://github.com/stephenhutchings/typicons.font
- elusiveicon https://github.com/reduxframework/elusive-icons
- materialdesign https://packagist.org/packages/mervick/yii2-material-design-icons
By Default Fontawesome icons
NOTE!
This extension not provide assets for icon source - you can setup and register it`s in view separately You can create needed assets, or direct include css of icon fonts from folder @bower/eliberty-bootstrap-iconpicker/icon-fonts
Usage
Once the extension is installed, simply use it in your code by :
<?= $form->field($model, 'icon')->widget('\cinghie\iconpicker\Iconpicker', [ 'iconset' => 'fontawesome', 'clientOptions' => [ 'rows' => 8, 'cols'=>10, 'placement' => 'right' ] ])->label('Choose icon') ?>
or without ActiveForm
<?php echo \cinghie\iconpicker\Iconpicker::widget([ 'id' => 'choose_icon', 'name' => 'myicon', 'value' => 'glyphicon-cog', 'iconset' => 'fontawesome', 'clientOptions' => [ 'placement' => 'bottom', 'search' => false ], 'pickerOptions' => [ 'class'=>'btn btn-primary' ] ]); ?>