Created
November 20, 2012 19:59
-
-
Save ornj/4120640 to your computer and use it in GitHub Desktop.
non-working constraint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function buildForm(FormBuilderInterface $builder, array $options) { | |
$subscriber = new AddDateFieldSubscriber($builder->getFormFactory()); | |
$builder->addEventSubscriber($subscriber); | |
$builder | |
->add('images', 'collection', array( | |
'type' => new UploadType(), | |
'required' => true, | |
'allow_add' => true, | |
'allow_delete' => true, | |
'by_reference' => false, | |
'prototype' => true, | |
'widget_add_btn' => array( | |
'icon' => 'plus-sign', | |
'label' => 'add', | |
), | |
'widget_type' => 'inline', | |
'options' => array( | |
'label_render' => false, | |
'widget_control_group' => false, | |
'widget_remove_btn' => array( | |
'icon' => 'minus-sign', | |
'label' => 'remove', | |
) | |
), | |
'constraints' => array( | |
new Collection(array( | |
'fields' => array( | |
'file' => new Image() | |
), | |
'allowMissingFields' => true, | |
)), | |
), | |
)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment