Re: [SMARTY] Re: Cycle and Config vars

From: Date: Tue, 29 Apr 2003 15:04:28 +0000
Subject: Re: [SMARTY] Re: Cycle and Config vars
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-9425@lists.php.net to get a copy of this message
I'm not sure if that works on any of your systems, but on mine it b0rks* when I use var=#color1# instead of var="#color1#" - And when I do the latter, #color1# is printed as a color, instead of the contents of #color1#. * Warning: Smarty error: eval: missing 'var' parameter in etc. -- -- Eskil Kvalnes <eskil@uten.net> http://www.hypothetic.net/ "Joel Lord" <joellord@stratagem-mgnt.com> wrote in message news:001c01c30e5f$387b9110$6600a8c0@joel... > Hi, > Not sure if it's the best way to do it but you could try using the > eval function. (see example below). > > Hope this helps, > Joel Lord > > ------------------------------------------- > > > Cycle.php > --------- > // Load Smarty > $smarty->display("cycle.tpl"); > > > Cycle.conf > ---------- > color1 = "#FF2CC9" > color2 = "#000000" > color3 = "#FFFFFF" > > > Cycle.tpl > --------- > {config_load file="cycle.conf"} > > <HTML> > <HEAD><TITLE>Cycle Test</TITLE></HEAD> > > <BODY> > {eval var=#color1# assign="color1"} > {eval var=#color2# assign="color2"} > <TABLE> > <TR BGCOLOR="{cycle values="$color1, $color2"}"> > <TD><FONT COLOR="{#color3#}">This is a test > !</FONT></TD> > </TR> > <TR BGCOLOR="{cycle}"> > <TD><FONT COLOR="{#color3#}">This is a test > !</FONT></TD> > </TR> > <TR BGCOLOR="{cycle}"> > <TD><FONT COLOR="{#color3#}">This is a test > !</FONT></TD> > </TR> > <TR BGCOLOR="{cycle}"> > <TD><FONT COLOR="{#color3#}">This is a test > !</FONT></TD> > </TR> > </BODY> > </HTML> > > > -----Original Message----- > From: Eskil Kvalnes [mailto:eskil@uten.net] > Sent: 29 avril, 2003 10:29 > To: smarty-general@lists.php.net > Subject: [SMARTY] Re: Cycle and Config vars > > Still no go. > > If I use bgcolor="{cycle values=#colorCycle#}" I get: Smarty error: > cycle: > missing 'values' parameter in etc. > and if I use bgcolor="{cycle values="#colorCycle#"}" I get > bgcolor="#colorCycle#".. > > -- > > -- > Eskil Kvalnes <eskil@uten.net> > http://www.hypothetic.net/ > "Tom Sommer" <webmaster@tsn.dk> wrote in message > news:lvaefhnufej7$.1rkya274qdfoy.dlg@40tude.net... > > On Tue, 29 Apr 2003 15:04:22 +0200, Eskil Kvalnes wrote: > > > > > In my config file (conf.colors.php) I have: > > > color1 = #A1A7B2 > > > color2 = #798291 > > > colorCycle = {#color1#},{#color2#} > > > > try > > colorCycle = #A1A7B2 > > colorCycle = #798291 > > > > and set > > $smarty->config_overwrite = false; > > before calling config_load > > > > Not sure, try :) > > > > -- > > Tom Sommer, Denmark > > www.tsn.dk - www.dreamcoder.dk > > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

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