I am trying to understand how Twig can load a template through AJAX. From their website, it is clear how to load a template (http://twig.sensiolabs.org/doc/api.html)
<
Directly in the template:
{% if app.request.isXmlHttpRequest() %} // code if ajax request {% else %} // code if not ajax request {% endif %}