cinghie/yii2-iconpicker

Yii2 Widget wrapper for bootstrap-iconpicker plugin http://victor-valencia.github.io/bootstrap-iconpicker/

Installs: 1 510

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 9

Type:yii2-extension

3.0.0 2017-06-27 17:27 UTC

This package is auto-updated.

Last update: 2023-01-22 06:10:10 UTC


README

License Latest Stable Version Latest Release Date Latest Commit Total Downloads

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:

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'
        ]
    ]);
?>