Re: [SMARTY] Config var bug?
| From: | Monte Ohrt | Date: | Mon, 24 Feb 2003 15:22:07 +0000 |
| Subject: | Re: [SMARTY] Config var bug? | ||
| References: | 1 2 3 4 5 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8152@lists.php.net to get a copy of this message | ||
Actually, I forgot that cycle will accept an array of values... so this
should work:
index.php
---------
$smarty = new Smarty;
$smarty->config_overwrite=false;
$smarty->display('index.tpl');
config.cnf
----------
var = "This is some text"
var = "This is another text"
var = "This is one more text"
index.tpl
---------
{config_load file="config.cnf"}
{cycle values=#var#}
{cycle values=#var#}
{cycle values=#var#}
On Mon, 2003-02-24 at 09:15, Nino Katic wrote:
> Monte,
>
> How can I access config var array from section? So suppose i have this:
>
> config.cnf
>
> var = "This is some text", "This is another text", "This is one more
> text"
>
> and now i want to print that var values from template, for example by using
> section?
>
> Nino
>
> Monte Ohrt wrote:
> > why not use a section or foreach, and make a real array of your text?
> > cycle is really meant for short pieces of text.
> >
> > On Sun, 2003-02-23 at 11:00, Nino Katic wrote:
> >> Jason Sweat wrote:
> >>> What about
> >>> var = "'one','two','three'"
> >>> ?
> >>
> >> I need this:
> >>
> >> var = "some text with spaces", "other text with spaces", "bla
> >> bla"
> >>
> >> and to do a cycle through that var in template.
> >>
> >> Thx. for help.
> >>
> >> Nino
--
Monte Ohrt <monte@ispi.net>