Created
January 16, 2018 13:07
-
-
Save GaylordP/cf82f85a2e9a209751b69e568fbec7d1 to your computer and use it in GitHub Desktop.
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
class PersonneVersionType extends AbstractType | |
{ | |
public function buildForm(FormBuilderInterface $builder, array $options) | |
{ | |
$builder | |
->add('emails', CollectionType::class, [ | |
'entry_type' => PersonneVersionEmailType::class, | |
'label' => false, | |
'allow_add' => true, | |
'allow_delete' => true, | |
'by_reference' => false, | |
]) | |
; | |
} | |
public function configureOptions(OptionsResolver $resolver) | |
{ | |
$resolver->setDefaults([ | |
'data_class' => PersonneVersion::class, | |
'label' => false, | |
]); | |
} | |
} | |
class PersonneVersionEmailType extends AbstractType | |
{ | |
public function buildForm(FormBuilderInterface $builder, array $options) | |
{ | |
$builder | |
->add('emaila', null, [ | |
'label' => 'label.email', | |
'ico' => 'envelope', | |
'translation_domain' => 'user', | |
]) | |
->add('principal', null, [ | |
'label' => false, | |
'translation_domain' => 'user', | |
]) | |
; | |
} | |
public function configureOptions(OptionsResolver $resolver) | |
{ | |
$resolver->setDefaults([ | |
'data_class' => PersonneVersionEmail::class, | |
'label' => false, | |
]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment