I understand that using {% render() %}
automatically forces a new request object to be sent, but im curious if theres a way to pass in the originating request a
Since Symfony 2.4 you can access the original request via the request_stack. This avoids the need to create a new method parameter.
function exampleAction() {
$request = $this->get('request_stack')->getMasterRequest();
//do something
}
Use this carefully as it makes your sub-requests incompatible with ESIs/reverse proxies (where a sub-request is also a master request) http://symfony.com/blog/new-in-symfony-2-4-the-request-stack