redking/fontawesome-picker-bundle

Font Awesome Picker for Symfony 2+

v1.7.0 2024-03-18 12:28 UTC

This package is auto-updated.

Last update: 2024-12-18 14:17:32 UTC


README

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
        ));
    }