knplabs/KnpPaginatorBundle — Issue #53: when included through twig routing throws error
Author: rbaarsma
Created: 2011-11-28 09:23:51+00:00
State: open

I have a twig page including another controller through the {% render() %} function.

In the included controller I render a template that includes the pagination render function.

I get an error on sliding.html.twig that there's no route for "" (empty route)

To solve the problem I changed the template a bit

I changed this on lines 7,13,20,30 and 36
{{ path(route, query|merge({'page': next})) }}

to this: (of course the param next should be changed to first/previous/page/last)
{{ route ? path(route, query|merge({'page': next})) : "?page="~next }}

To get this to work I also needed to give the second parameter (page) to the paginate() function directly from _GET() -- since it's not gotten correctly from either $request->query or $request itself.

The solution I used may just be a quickfix. Probably there's also a better solution to this.