Skip to content

Extract empty_values of form field choice/entity type #17

althaus opened this Issue Dec 20, 2011 · 0 comments

2 participants

althaus commented Dec 20, 2011

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,



@schmittjoh schmittjoh closed this in efd01bc Jan 4, 2012
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.