Re: [SMARTY] Building arrays within templates
| From: | Mark Rogers | Date: | Fri, 04 Jul 2003 08:10:20 +0000 |
| Subject: | Re: [SMARTY] Building arrays within templates | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-9834@lists.php.net to get a copy of this message | ||
"messju mohr" writes:
> there is no nice syntax for this. you can do sth. like
> {include file="mytemplate.tpl"
> data=","|explode:"line1,line2,line3"}
> which is an ugly hack.
Hmm, OK - I might play with this and see if it makes the template easier to
read, but probably not.
Thinking about assign instead, re-writing it to take an array parameter in
place of a var parameter would be trivial, ie instead of trying to make
{assign var="data[]" value="Line1"}
work we'd have
{assign array="data" value="Line1"}
and even
{assign array="data" separator="," value="Line1,Line2,Line3"}
I might play with that instead.
Mark Rogers,
More Solutions Ltd