I’m currently using a choice field (with the option “expanded” set to true) to display a list of radio buttons to select a value. I’d like to change the way it is rendered by $view['form']->widget() and already have another global template in src/MyProject/ABundle/Resources/views/Form/choice_widget.html.php which can not be changed.
How do I specify a new template for the radio buttons in a php view (no twig)?
While coming back, here is how it can easily be done but the symfony official doc is not clear.
Put your
choice_widget.html.phpinsrc/YourProject/YourBundle/Resources/view/Something/then when you need a radio button themed with it, use:With $form being your form view.