Re: [SMARTY] "Variable substitution"
| From: | messju mohr | Date: | Thu, 03 Mar 2005 15:11:45 +0000 |
| Subject: | Re: [SMARTY] "Variable substitution" | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12293@lists.php.net to get a copy of this message | ||
On Thu, Mar 03, 2005 at 03:46:16PM +0100, Mattias Hallström wrote:
> A thought I got directly after posting...
> Maybe it's better to use an array for this kind?!
yes and yes :)
> > -----Original Message-----
> > From: Mattias Hallström [mailto:di98mha@student.bth.se]
> > Sent: den 3 mars 2005 15:36
> > To: smarty-general@lists.php.net
> > Subject: [SMARTY] "Variable substitution"
> >
> > Hi everyone,
> >
> >
> >
> > I am trying to get the value of a smarty variable by generating the
> > variables name, but I cant figure out how to
> >
> >
> >
> > I have variables named: $class1, $class2, $class3 etc.
> >
> > Then I have a {section} to get the numbers 1, 2, 3 etc
> >
> >
> >
> > {assign var="className"
> > value="class"
$attributeNr} (attributeNr is
> > the
> > counter: 1,2,3
)
> >
> >
> >
> > Now I have class1, class2 etc in className, but how do I display the
> > value of the variables $class1, $class2 etc?
> >
> >
> >
> > Best Regards,
> >
> > Mattias Hallström
> >
> > Problem.se Intelligent Web Solutions Sweden
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php