I'm trying to get KnpPaginatorBundle to default the "order by" after the query has been made.
I have tried the following but has proven no luck!
[
'defaultSortFieldName' => 'i.name',
'defaultSortDirection' => 'desc'
]
The reason for doing it like this is because my next sort-able option doesn't need to sort by name hence not wanting to include the order by in the query.
Any ideas?
I belive the KnpPaginatorBundle will alter and play with your $_GET globals, which is not ideal. I have found the better alternative is to control sorting yourself.
A minimal example: