Skip to content
This repository

Extract empty_values of form field choice/entity type #17

althaus opened this Issue · 0 comments

2 participants

Matthias Althaus Johannes
Matthias Althaus

You can set the caption for the empty value element in select boxes generated by choice/entity form field types by just setting it to a string:

$builder->add('states', 'choice', array(
    'empty_value' => 'Choose an option',

This could be extracted by the bundle.

Be aware: empty_values can also be set to FALSE so that no option is generated at all. Possible solution would be to force the user to use @Ignore or to automatically check for the boolean value.

$builder->add('states', 'choice', array(
    'empty_value' => false,



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.