what is the difference between MASTER / SUB REQUEST in Symfony2?
The master request is the one that comes from the original user; the subrequest is the one that you do internally — either with the forward()
method of HttpKernel
— or by the forward()
helper of the framework's Controller
class — or {% render ... %}
in Twig.
The master request is the one, that is triggered by the browser and the sub requests are requests from within the application. For example a template can render another action
<div id="sidebar"> {% render "AcmeArticleBundle:Article:recentArticles" with {'max': 3} %}</div>
(Example taken from the manual)
This will lead to a sub request.