Symfony has an EntityType field that allows a <select>
field to be automatically populated by rows in a table. Going further, these rows can be categorized into <optgroup>
clusters if the group_by option is given a property path.
Example:
$builder->add('categories', EntityType::class, [
'class' => PostCategory::class,
'group_by' => 'column_name',
'mapped' => FALSE,
]);
Given this code snippet, how would I change the rendered <optgroup>
text? For example, how would I humanize (e.g. capitalize) it?