Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3925

Symfony 4 Forms: implementing per-Entity custom sorting in QueryBuilder for ChoiceType fields

$
0
0

I seem to have some troubles getting my head around the intrinsics of the Symfony (4) Form component.

I want to:

a) store information per-Entity(Repository?) on how the default sort order should be, like $entityRepository->sortOrder = ['default' => ['LastName ASC', 'FirstName ASC'], 'custom1' => [...]];

b) use that information to instruct the Form to use that ordering with the query_builder option/attribute for the ChoiceType form field

So the question is, how/where should i ideally store that information and how should i feed this to the Form object / QueryBuilder?

Pointing me in a direction doing it in a "industry-standard" fashion would be greatly appreciated.


Viewing all articles
Browse latest Browse all 3925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>