ucs / form
UCS Array Form Component
0.9
2015-06-29 18:53 UTC
Requires
- php: >=5.3.2
- doctrine/collections: 1.2.*
- symfony/event-dispatcher: >=2.4, <3
- symfony/form: >=2.4, <3
- symfony/http-foundation: >=2.4, <3
- symfony/intl: >=2.4, <3
- symfony/options-resolver: >=2.4, <3
- symfony/property-access: >=2.4, <3
- symfony/validator: >=2.4, <3
This package is not auto-updated.
Last update: 2019-09-15 15:55:46 UTC
README
Additional form types for Symfony2:
ArrayFormType
This allows you to build forms from an array definition, this can be very usefull for custom forms loaded from json.
define your fields like the following:
<?php $options = array( 'name' => array( 'type' => 'group', // Can be 'item', // If its a group 'items' => array(), // With same construction as this sample // Else 'value' => 'blabhblahblah', 'widget' => array( 'type' => 'text', 'options' => array( 'label' => 'Name', 'help_block' => 'patati patata', 'trans_domain' => 'MyDomain', 'required' => true, 'max_length' => 255, 'constraints' => array( 'length' => array( 'min' => 5, 'max' => 255 ) ) ) ) ) );
Constraints will be translated into proper symfony2 validation constraints and registered properly in the UCS internal ConstraintMapping.