Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

Commit

Permalink
bug #1522 Error using EsiFragment with provider and twig functions (m…
Browse files Browse the repository at this point in the history
…ihailov-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
-------

c6bbc48 Update HttpFragmentServiceProvider.php
  • Loading branch information
fabpot committed Jun 15, 2017
2 parents 9cbf194 + c6bbc48 commit 6260671
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Silex/Provider/HttpFragmentServiceProvider.php
Expand Up @@ -51,7 +51,7 @@ public function register(Container $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']);

return $renderer;
Expand Down

0 comments on commit 6260671

Please sign in to comment.