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.
你总是可以setLabel
在表格中查看:
$this->widgetSchema->setLabel('YOUR_WIDGET', 'NAME <em>*</em>');
这将显示小部件:NAME *
然后您可以在 CSS 中设置样式