Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion twig render with variable
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Christophe COEVOET  
View profile  
 More options Oct 30 2012, 3:59 pm
From: Christophe COEVOET <s...@notk.org>
Date: Tue, 30 Oct 2012 20:59:17 +0100
Local: Tues, Oct 30 2012 3:59 pm
Subject: Re: [Symfony2] twig render with variable
Le 30/10/2012 20:55, Vincent Wasteels a crit :
> Hello

> I need to render a template whose name depends on a variable ,
> something like this :

> {% include "TeeltFicheBundle:Explorer:showResults_{{ type }}.html.twig" %}

> do you have any idea ? my doc reading leads nowhere !

> thanks

Use either the concatenation operator o the interpolation, not a echo
syntax (just like you would do in PHP to use a variable in a string btw)

concatenation: http://twig.sensiolabs.org/doc/templates.html#other-operators
interpolation:
http://twig.sensiolabs.org/doc/templates.html#string-interpolation

--
Christophe | Stof


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.