2017 © Pedro Peláez
 

library form-twitter-bundle

Implementation of Bootstrap Form Types for Symfony 2

image

rc2c/form-twitter-bundle

Implementation of Bootstrap Form Types for Symfony 2

  • Wednesday, October 21, 2015
  • by rc2c
  • Repository
  • 4 Watchers
  • 1 Stars
  • 3,106 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Rc2cFormTwitterBundle

This bundle provides symfony 2 form types powered by twitter bootstrap., (*1)

Requirements

  • Symfony 2.x
  • Twitter bootstrap and jquery already loaded in your layout

Installation

Add the repository to your composer.json, (*2)

"rc2c/form-twitter-bundle": "dev-master"

Run Composer to install the bundle, (*3)

php composer.phar update rc2c/form-twitter-bundle

Enable the bundle in AppKernel.php, (*4)

    new Rc2c\FormTwitterBundle\Rc2cFormTwitterBundle(),

Multiselect

The Bootstrap Multiselect jquery plugin present in this bundle is from davidstutz. Use the new form type in a buildForm method in remplacement of a choice type, (*5)


public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('my_choices', 'multiselectchoice', array( 'label' => ' ', 'read_only' => true, 'choices' => array(...) )) ; }

You can set some options to change the behaviour of the widget :, (*6)

    array(
        'btnSelectAll' => false, // (default: true) Disables the "select all" button
        'buttonClass'  => 'btn-primary', // (default : "btn") Set the class of the dropdown button 
        'maxHeight'    => 450, // (default: false) Set a max height of the dropdown list
    )

The Versions

21/10 2015

dev-master

9999999-dev https://github.com/rc2c/Rc2cFormTwitterBundle

Implementation of Bootstrap Form Types for Symfony 2

  Sources   Download

MIT

The Requires

 

form bootstrap symfony2 multiselect