symfony form label from required widget with stars
Question
I'm searching the best way to output a label of a widget with a star (*) if this widget is required. It should be automatic.
I didn't find any way to do it :(
Solution
One way to do this is to use a custom form formatter.
OTHER TIPS
You could always look at setLabel
in the form clas:
$this->widgetSchema->setLabel('YOUR_WIDGET', 'NAME <em>*</em>');
This will show the widget: NAME *
which you can then style in CSS
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow