symfony form label from required widget with stars
Вопрос
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 :(
Решение
One way to do this is to use a custom form formatter.
Другие советы
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
Не связан с StackOverflow