From 12e1fc7f3505237ee74518a09f210e0e1cd67b4e Mon Sep 17 00:00:00 2001 From: Alan Farquharson Date: Wed, 6 Aug 2014 14:44:37 +0100 Subject: [PATCH] Update http_cache.rst Explained how the parameters are passed to the controller - named parameters --- book/http_cache.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/book/http_cache.rst b/book/http_cache.rst index 0ad04bb9379..92e276093de 100644 --- a/book/http_cache.rst +++ b/book/http_cache.rst @@ -930,6 +930,19 @@ wondering why you would want to use a helper instead of just writing the ESI tag yourself. That's because using a helper makes your application work even if there is no gateway cache installed. +.. tip:: + + Using render_esi with parameters doesn't use request variables - they are + passed in as named parameters. They must be named the same. + + e.g. ``render_esi(controller('...:content', { max_per_page: 5, type: 'news' }`` + +.. code-block:: php + + public function content($max_per_page = 10, $type = "news") + { + + When using the default ``render`` function (or setting the renderer to ``inline``), Symfony2 merges the included page content into the main one before sending the response to the client. But if you use the ``esi`` renderer