add a required field to custom fields type

ref Chill-project/Chill-CustomFields#17
This commit is contained in:
2015-12-10 17:16:59 +01:00
parent b88bb50b56
commit 3230659a4b
11 changed files with 136 additions and 2 deletions

View File

@@ -66,6 +66,11 @@ class CustomFieldType extends AbstractType
$builder
->add('ordering', 'number')
->add('required', 'checkbox', array(
'required' => false,
//'expanded' => TRUE,
'label' => 'Required field'
))
->add('type', 'hidden', array('data' => $options['type']))
->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event)
{