I'm developing with Symfony2, I want to send the variable myDate to my custom page 503 (error503.html.twig).
{# error503.html.twig #}
{% if myDate is not null or myDate is not empty %}
Start date : {{ myDate }}
{% else %}
{{ render(controller('MyBundle:myController:index')) }}
{% endif %}
When the service is not available, the page 503 is displayed, but the variables are not sent to this page from the controller. I tried with the render template and it does not work (no error, just no variable that appears).
/** myController.php **/
public function indexAction()
{
...
return $this->render('TwigBundle:views:Exception:error503.html.twig', array(
'myDate' => $startDate,
));
...
}
I specify that it works with 403, 404 ... but not with the 503 exception . Thanks for your help.