sampart/WhiteOctoberPagerfantaBundle

Support of subrequests

Closed this issue · 3 comments

stof commented

When building the route in the Twig extension, you use the current request to get the route. this fails for subrequests (e.g. $this->forward() or {% render %}) and ESI requests (e.g. {% render with {}, {'standalone': true} %}) as in this cases you don't use the master request containing the true route but an _internal route that should not be available to the end-user but only to the proxy cache (or not at all if you don't use ESI).
There is no way to solve this for ESI as only the cache knows about the main request, and so giving the route explicitly is needed (which is already supported). However, this can be solved for subrequests. See the implementation I wrote for KnplabsPaginatorBundle

I'm with stof, it could be a great feature (I've put PagerfantaBundle in my Project, and first use case was to use it in a subrequest).
I'm nearly a newbie in Symfony2 so make the patch seem a bit difficult for me now.

What's the state of this issue? We can now customize the route name and params when paginating, so we should be able to use subrequests indicating those things explicitly.

stof commented

yep, passing the route name explicitly was the needed stuff.