Bonjour,
Je ne parviens pas à lier des constantes php à mes balises smarty.
code php
1 2 3 4 5
| $tab=array("a1","a2","a3");
define ("a1", "accueil");
define ("a2","Liste");
define ("a3","Courrier");
$smarty->assign("liste",$tab); |
tpl smarty
1 2 3 4 5
|
{foreach from=$liste item=l}
{$smarty.const.$l}
<br/>
{foreach} |
Je souhaite voir apparaitre :
1 2 3
| accueil
Liste
Courrier |
mais j'ai l'erreur :
Fatal error: Smarty error: [in sousmenu/admin_apparence_conf_site_liste.tpl line 35]: syntax error: $smarty.$l is an invalid reference (Smarty_Compiler.class.php, line 2155) in C:\www\monsite\bissi\smarty\libs\Smarty.class.php on line 1092
merci du coup de main
Partager