Extra form types for symfony 2
- Double list type based on jQuery multiselect2side plugin
If you use composer, add ExtraFormBundle bundle as a dependency to the composer.json of your application
"require": {
...
"snide/extra-form-bundle": "dev-master"
...
},
Add SnideExtraFormBundle to your application kernel.
// app/AppKernel.php
<?php
// ...
public function registerBundles()
{
$bundles = array(
// ...
new Snide\Bundle\ExtraFormBundle\SnideExtraFormBundle(),
);
}
The bundle needs to copy the resources necessary to the web folder. You can use the command below:
php app/console assets:install
This bundle comes with an extension for Twig. To init CSS scripts use
This makes it very easy to include the extra form Javascript and CSS into your pages only if needed. It will output the complete Javascript, including <script>
tags and add stylesheets. Add it to the bottom of your page.
{{ snide_extra_form_init() }}
snide_extra_form:
include_jquery: true
The option include_jquery
allows you to load external jQuery library from the Google CDN. Set it to true
if you haven't included jQuery on your page.