Commit 6260671f authored by Fabien Potencier's avatar Fabien Potencier

bug #1522 Error using EsiFragment with provider and twig functions (mihailov-vf)

This PR was merged into the 2.1.x-dev branch.

Discussion
----------

Error using EsiFragment with provider and twig functions

Trying to use twig functions "controller" and "render_esi" like [Symfony esi reference](http://symfony.com/doc/current/http_cache/esi.html) , i've noticed the following error:
An exception has been thrown during the rendering of a template ("You must use a URI when using the ESI rendering strategy or set a URL signer.").

It's the lack of a UriSigner on the constructor.

Commits
-------

c6bbc48b Update HttpFragmentServiceProvider.php
parents 9cbf194d c6bbc48b
...@@ -51,7 +51,7 @@ class HttpFragmentServiceProvider implements ServiceProviderInterface, EventList ...@@ -51,7 +51,7 @@ class HttpFragmentServiceProvider implements ServiceProviderInterface, EventList
}; };
$app['fragment.renderer.esi'] = function ($app) { $app['fragment.renderer.esi'] = function ($app) {
$renderer = new EsiFragmentRenderer($app['http_cache.esi'], $app['fragment.renderer.inline']); $renderer = new EsiFragmentRenderer($app['http_cache.esi'], $app['fragment.renderer.inline'], $app['uri_signer']);
$renderer->setFragmentPath($app['fragment.path']); $renderer->setFragmentPath($app['fragment.path']);
return $renderer; return $renderer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment