KnpLabs/KnpPaginatorBundle — pull request #88 by loostro (2012-02-24 17:16:57+00:00)
Title: passing key to sortable_link template

The key is sometimes needed in the template. For example, if you want to replace tags with form submit buttons.

for example: (# in my custom template -> button_sortable_link.html.twig)

then in the controller:

if($request->request->has('sort'))
// return template with data sorted by $key = $request->request->get('sort')

Example of usage:

I have a Create UserGroup form with $roles array (which is a collection of Roles).
Below standard field like UserGroup name or UserGroup description I have a list of Roles which is Paginated.

If I click link to browse roles list to another page - I loose my input. So I chose to replace it with submit buttons - this way my input is submitted and re-entered into response.