Re: [SMARTY] variable name problem (SORTED !!! THANKS !!!)

From: Date: Wed, 07 May 2003 22:22:05 +0000
Subject: Re: [SMARTY] variable name problem (SORTED !!! THANKS !!!)
References: 1 2 3 4 5  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-9502@lists.php.net to get a copy of this message
Dear Luc, David and Messju, thnaks for all your help !!! It is now sorted. For information in case somebody else has the problem: I used: test 1 (GOOD !!!): {assign var="incoming" value="FORM_CHRG_$keyid_INCOMING"} {$incoming} result 1 : FORM_CHRG_11_INCOMING I updated SMARTY to the latest version (2.5.0) to use the backtrick feature. Thanks a lot again !!! Guillaume www.inmeres.com ----- Original Message ----- From: "messju mohr" <messju@lammfellpuschen.de> To: "Guillaume Justier" <newsgroup@inmeres.com> Cc: "Wom.bat" <wom.bat@gmx.net>; <smarty-general@lists.php.net> Sent: Wednesday, May 07, 2003 10:49 PM Subject: Re: [SMARTY] variable name problem > On Wed, May 07, 2003 at 10:38:03PM +0100, Guillaume Justier wrote: > > Hi David, > > > > Thanks for putting me on the good track, I found the backtick syntax on the > > smarty site thanks to your mail. > > However, it still doesn't work!! > > I have done some various tests, as shown below: > > Result wanted : FORM_CHRG_11_INCOMING > > > > test 1 (not good): > > {assign var="incoming" > > value="FORM_CHRG_$keyid_INCOMING"} > > {$incoming} > > result 1 : FORM_CHRG_11_INCOMING > > you need Smarty-2.5.0 to make the backticks-notation work. your output > looks like 2.4.2. > > or you can try a modifier (use 2 cats or an sprintf): > {assign var="incoming" value="FORM_CHRG_%d_INCOMING"|sprintf:$keyid} > (%d for numeric $keyid, %s instead of %d for strings) > > {assign var="incoming" > value="FORM_CHRG_"|cat:$keyid|cat:"_INCOMING"} > > > > test 2 (not good): > > {assign var="incoming" value="FORM_CHRG_$keyid_INCOMING"} > > {$incoming} > > result 2 : FORM_CHRG_ > > > > > > test 3 (not good): > > {assign var="incoming" value="FORM_CHRG-$keyid-INCOMING"} > > {$incoming} > > result 3 : FORM_CHRG_11_INCOMING (this kinda works presumably because - act > > as a delimiter) > > > > > > test 4 (not good): > > {assign var="incoming" value="FORM_CHRG{$keyid}INCOMING"} > > {$incoming} > > result 4 : FORM_CHRG_{11 > > > > I am not quite sure what to try now !!! > > > > Does anybody know how to fix that ? > > > > Thanks in advance, > > > > Best regards, > > Guillaume > > www.inmeres.com > > > > ----- Original Message ----- > > From: "Wom.bat" <wom.bat@gmx.net> > > To: "Guillaume Justier" <newsgroup@inmeres.com> > > Cc: <smarty-general@lists.php.net> > > Sent: Wednesday, May 07, 2003 6:20 PM > > Subject: Re: [SMARTY] variable name problem > > > > > > > > Does anyone knows why : > > > > {assign var="incoming" value="FORM_CHRG_$keyid_INCOMING"} > > > > is not valid ? > > > > > > try the backtick syntax: > > > > > > {assign var="incoming" > > > value="FORM_CHRG_$keyid_INCOMING"} > > > > > > > > > Cheers, > > > David > > > > > > > > > > > > -- > > > Smarty General Mailing List (http://smarty.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > > -- > > Smarty General Mailing List (http://smarty.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.smarty.general (#9502) next »