Download the PHP package alsatian/form-bundle without Composer
On this page you can find all versions of the php package alsatian/form-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package form-bundle
FormBundle
This bundle provide FormTypes extending ChoiceType, EntityType and DocumentType to let them accept additional choices added on the client side.
Ideal for Select2 integration.
Use version 1.1 for Symfony >= 4.4 Use version 1.0 for Symfony 2.8 to 4.3
Features
The bundle provide 6 FormTypes designed to automate some common tasks :
-
ExtensibleChoiceType : Extension for the built-in ChoiceType
Choice type which starts with an empty HTML select and accept each submitted choice which has be added on the client side.
- Configuration : Insert %alsatian_form.parameters.extensible_choice.attr_class% as class for the HTML select.
- Options : 'route' and 'route_params' to render a data-ajax--url tag in the HTML select.
-
ExtensibleEntityType : Extension for the built-in EntityType
Entity type type which starts with an empty HTML select and accept each existing entity which has be added on the client side.
- Configuration : Insert %alsatian_form.parameters.extensible_entity.attr_class% as class for the HTML select.
- Options : 'route' and 'route_params' to render a data-ajax--url tag in the HTML select.
-
ExtensibleDocumentType : Extension for the DoctrineMongoDBBundle DocumentType
Document type which starts with an empty HTML select and accept each existing document which has be added on the client side.
- Configuration : Insert %alsatian_form.parameters.extensible_document.attr_class% as class for the HTML select.
- Options : 'route' and 'route_params' to render a data-ajax--url tag in the HTML select.
-
AutocompleteType : Extension for the built-in TextType
Text type allowing to add some html attributes to expose ajax route for autocompletion.
- Configuration : Insert %alsatian_form.parameters.autocomplete.attr_class% as class for the HTML input.
- Options : 'route' and 'route_params' to render a data-ajax--url tag in the HTML input.
-
DatepickerType : Extension for the built-in DateType
Date type where the date pattern is rendered as 'pattern' attribute in the HTML input (Using \IntlDateFormatter::SHORT).
- Configuration : Insert %alsatian_form.parameters.date_picker.attr_class% as class for the HTML input.
-
DateTimepickerType : Extension for the built-in DateTimeType
DateTime type where the date pattern is rendered as 'pattern' attribute in the HTML input (Using \IntlDateFormatter::SHORT).
- Configuration : Insert %alsatian_form.parameters.datetime_picker.attr_class% as class for the HTML input.
Installation
Download the bundle with composer
Enable the bundle
Add the bundle to app/AppKernel.php :
Configuration
Add following lines to app/config/config.yml
For each FormType you can configure a default attr_class parameter, like this :
Usage
To use these FormTypes :
This will render HTML like :
The aim of this bundle is only to do the server side work (allowing "extensible" choices). You have to write your own Javescript adapters to get it work with Select2.
As example, how I use it :
All versions of form-bundle with dependencies
symfony/config Version ^4.4|^5.0|^6.0|^7.0
symfony/dependency-injection Version ^4.4|^5.0|^6.0|^7.0
symfony/form Version ^4.4|^5.0|^6.0|^7.0
symfony/http-kernel Version ^4.4|^5.0|^6.0|^7.0
symfony/options-resolver Version ^4.4|^5.0|^6.0|^7.0
symfony/routing Version ^4.4|^5.0|^6.0|^7.0