2017 © Pedro Peláez
 

yii2-extension yii2-fa-icon-selector

Widgets to add fontAwesome icons to a model. For example, categories for posts.

image

cenotia/yii2-fa-icon-selector

Widgets to add fontAwesome icons to a model. For example, categories for posts.

  • Tuesday, January 3, 2017
  • by xavsio4
  • Repository
  • 2 Watchers
  • 0 Stars
  • 34 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

YII2 Fa Icon Selector

yii2-fa-icon-selector, (*1)

This widget can be attached to a model attribute in order to associate a FontAwesome icon to it with optional orientation, size and color.

#

Prerequisite

This widget is a wrapper for Bootstrap IconPicker and concentrates only on the FontAwesome part and some of its helpers Font Awesome., (*2)

Installation

The preferred way to install FaiconSelector is through Composer. Either add the following to the require section of your composer.json file:, (*3)

"cenotia/yii2-fa-icon-selector": "dev-master", (*4)

Or run:, (*5)

$ php composer.phar require cenotia/yii2-fa-icon-selector "dev-master", (*6)

You can manually install FaiconSelector by downloading the source in ZIP-format., (*7)

Using FaiconSelector

FaiconSelector is a Yii 2.0 InputWidget. Like any other InputWidget it can be associated with a model and an attribute (or with a name and a value)., (*8)

FaiconSelector is in namespace cenotia\components\faiconSelector., (*9)

For instance, to associate faiconSelector with the attribute 'cat_icon' in a form view, use code like this:, (*10)

use cenotia\components\faiconSelector\FaiconSelector;

...
<?php echo $form->field($model, 'cat_icon')->widget(FaiconSelector::className()) ?>
...

//The class string is what will be stored. Example: fa fa-bank fa-2x
//So your field should be a varchar of 100 at least.
//So you will just to display like this for example.

...
<i class="<?= $model->cat_icon ?>"></i>
... 

options

De facto, InputWidget properties can also be used., (*11)

More options to be documented in coming versions., (*12)

The Versions

03/01 2017

dev-master

9999999-dev https://github.com/cenotia/yii2-fa-icon-selector

Widgets to add fontAwesome icons to a model. For example, categories for posts.

  Sources   Download

MIT

The Requires

 

extension yii2 widget font-awesome inputwidget