RE: [SMARTY] Re: Cycle and Config vars
| From: | Joel Lord | Date: | Tue, 29 Apr 2003 14:54:22 +0000 |
| Subject: | RE: [SMARTY] Re: Cycle and Config vars | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9424@lists.php.net to get a copy of this message | ||
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