I am using the formbuilder querybuilder with choice label:
$options['query_builder'] = function (EntityRepository $er) use ($fieldId) {
$output = $er->createQueryBuilder('c')
->orderBy('c.name', 'ASC');
return $output;
};
$options['choice_label'] = 'category';
It works very well, also when I try to get the name instead:
$options['choice_label'] = 'name';
But what I would need is a combination of both in my dropdown, but still keep the ordering.
$options['choice_label'] = 'category -> name';
I cannot figure out how to do that. I am grateful for any advice.