As described here,
required
type: Boolean default: true
required
option default value is set to true
, so you should then set it to false
.
builder->add('student', 'choice', array(
'label'=> false,
'expanded' => true,
'required' => false,
//...
))
;
Also, you can read from documentation that,
This is superficial and independent from validation. At best, if you let Symfony
guess your field type, then the value of this option will be guessed from your
validation information.
You need then to set a validation rule that take into account the fact that your field should not be required in order to let your form set the right value of required.
This may probably help.