Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get an URL to reset the sorting? #306

Closed
Mondane opened this issue Apr 29, 2015 · 2 comments
Closed

How to get an URL to reset the sorting? #306

Mondane opened this issue Apr 29, 2015 · 2 comments

Comments

@Mondane
Copy link

Mondane commented Apr 29, 2015

For now, I can generate an URL using this:

{{ path(app.request.attributes.get('_route'), {}) }}

Which will give me an URL without parameters. This does reset the order, but also any other request parameter I might had (eg. filters).

Is there a function, or can one be added, in KnpPaginatorBundle that generates a 'clear sortorder' URL which keeps the other parameters intact?

@Mondane
Copy link
Author

Mondane commented Aug 18, 2015

For now, I've worked around it like this:

{{ path(app.request.attributes.get('_route'), filterParameters|merge(paginationParameters)) }}

The filterParameters hold any filters applied and in paginationParameters, I store the number of items to show per page. Both are arrays like parameter => value.

@polc polc added the feature label Sep 13, 2017
@garak
Copy link
Collaborator

garak commented Jul 19, 2019

I'm not sure to understand the value of "resetting order".
Every list has a default order, so the action of resetting is just the action of setting the order to that default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants