Extending different layouts for Ajax requests in Twig, Symfony2

I just learned about the ‘app’ global variable in twig. It’s very handy for loading a special layout for ajax requests.

{% extends app.request.isXmlHttpRequest ? “::ajaxLayout.html'clear:both;'>

Leave a Reply

Your email address will not be published.