|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
escteban Smarty Rookie
Joined: 20 Apr 2007 Posts: 10
|
Posted: Wed May 02, 2007 12:43 pm Post subject: nom de variable smarty composé d1 chaine et d1 variable |
|
|
Bonjour a tous,
Je voudrais savoir si qq un peut m'aider a trouver comment faire dans smarty l equivalent de
${$autre_var."string"}
en php?
Merci par avance pour vos reponses. |
|
Back to top |
|
Shepard8 Smarty n00b
Joined: 08 Aug 2007 Posts: 2
|
Posted: Wed Aug 08, 2007 7:46 pm Post subject: |
|
|
Peut-être un début de réponse, mais vachement complexe pour si peu ^^ Au moins ça fonctionne, si quelqu'un trouve mieux ...
Code: | {assign var="test_nom" value="C'est la variable qu'on veut afficher; test est stocké dans la variable [dynvar] et _nom est ajouté [à la main]."}
{assign var="dynvar" value="test"}
{capture assign="dyn"}{ldelim}${$dynvar}_nom{rdelim}{/capture}{eval var=$dyn} |
Peut-être que ce serait une bonne idée d'en faire une fonction utilisateur ? |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|