I have hard space ( ) inside some of my choices. Somehow somewhere they run away. I tried:
{% autoescape false %}
{{ form_widget(foobar) }}
{% endautoescape %}
Like
{{ form_widget(foobar)|raw }}
And in the Twig in section config.yml
autoescape: false
However, the selection fields are still displayed as Choice Text Hereinstead Choice Text Here, and in the source they are encoded as Choice Text Here
In the controller, I have:
$form ->add('foo', 'choice', array(
'label' => 'Foo Label',
'choices' => $fooChoices,
'required' => true));
$form = $form->getForm();
$foobar = $form->createView();
If I print_r $fooChoices, I get:
Array ( [1] => 60
Which shows me the correct one (note the double space before the 60s). Somewhere between FormBuilder and rendering, it slips away.
Is there built-in escaping inside Form Builder?
, , , , $form->createView(), . , Twig form_widget, . form_widget(foobar)|raw .
: , , , .