Skip to content

zeliard91/FontAwesomePickerBundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FontAwesome Picker Bundle

Build Status

Implementation of FontAwesome Picker Form Type for Symfony 2+

Installation

Donwload the bundle with composer.

composer require redking/fontawesome-picker-bundle

Register the bundle in the kernel.

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Redking\FontAwesomePickerBundle\RedkingFontAwesomePickerBundle(),

    );
}

Add the following js and css to your layout assets :

  • /bundles/redkingfontawesomepicker/js/fontawesome-iconpicker.min.js
  • /bundles/redkingfontawesomepicker/css/fontawesome-iconpicker.min.css

Usage

Use the form type as usual :

use Redking\FontAwesomePickerBundle\Form\Type\FontAwesomeType

// ...
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('icon', FontAwesomeType::class, array(
            'picker_options' => [], // You can pass here the options of the widget
        ));
    }