Ok, thanks !

It works fine in the controller, but the line "{% extends ajax ? "" : "MyBundle::layout.twig.html" %}" in the Twig file, bugs :

Template name "" is not valid (format is "bundle:section:template.engine.format").



Christophe



Le 27/02/2011 20:58, Christophe COEVOET a écrit :
Le 27/02/2011 20:48, Christophe Beyer a écrit :
Hello,

I want to display a template in two modes : the "normal" mode,
embedded in the main layout, and an ajax mode; without duplicate my
template of course.

1. In my controller, how can I check if the requested url is an ajax
request (without adding any parameter) ?
$this->container->get('request')->isXmlHttpRequest()

2. In the Twig file, I tried to make this :
{% if ajax %}{% extends "MyBundle::layout.twig.html" %}{% endif %}
but it doesn't work.
{% extends ajax ? "" : "MyBundle::layout.twig.html" %}

Regards


--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to