You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In your controller, when you create the form, you can add the initial data (the second argument of the createForm method).
Which initial data are you using ?
Also keep in mind that placeholder for ChoiceType will be added only if choices doesn't contain empty value.
// Check if the choices already contain the empty value// Only add the placeholder option if this is not the caseif (null !== $options['placeholder'] && 0 === count($options['choice_list']->getChoicesForValues(array('')))) {
$placeholderView = newChoiceView(null, '', $options['placeholder']);
// "placeholder" is a reserved name$this->addSubForm($builder, 'placeholder', $placeholderView, $options);
}
I have such field:
Why my placeholder radio isn't selected? Is it expected behaviour? I also trying to set required => true for my field
The text was updated successfully, but these errors were encountered: