Re: [SMARTY] Accessing arrays in value-property of {assign}
| From: | Ronny 'Ronino' Multrus | Date: | Fri, 14 Mar 2003 16:39:36 +0000 |
| Subject: | Re: [SMARTY] Accessing arrays in value-property of {assign} | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8660@lists.php.net to get a copy of this message | ||
> backticks are only for variables imbedded in double quotes.
Hmm, so I can either have access to arrays in {assign} without double quotes
or dynamic (non-array) variables with backticks but _in_ double quotes.
This is somewhat confusing (i.e. not necessarily logical), but it would be
kinda nice to have both of them though ;-).
Ronino
> > > > is there any way of assigning values of an array in {assign}?
> > > >
> > > > {assign var="someVar" value="$someArray.someValue"}
> > >
> > > use {assign var="someVar" value=$someArray.someValue}
> > Okay, thx, this works for known array members, but not dynamic ones
> > between backticks:
> >
> > {section name="images" loop=3}
> > {assign var="picNum" value=$smarty.section.images.iterator}
> > {assign var="pic_text"
> > value=$smarty.post.pic_
picNumtext}
> > <b>{$pic_text}</b>
> > {/section}
> >
> > I get:
> > Fatal error: Smarty: [in template.tpl line 8]: syntax error: $smarty. is
> > an unknown reference (Smarty_Compiler.class.php, line 1759) in
> > /path/to/Smarty_Compiler.class.php on line 1812