RE: [SMARTY] Question or feature suggestion: Arrays(hashes?) viaconfig files
| From: | Monte Ohrt | Date: | Tue, 18 Feb 2003 17:03:25 +0000 |
| Subject: | RE: [SMARTY] Question or feature suggestion: Arrays(hashes?) viaconfig files | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7836@lists.php.net to get a copy of this message | ||
or we could supply direct access to the config array with
$smarty.config:
{foreach from=$smarty.config key=key item=item}
{$key} : {$item}
{/foreach}
Does that have any advantages?
On Tue, 2003-02-18 at 10:41, Monte Ohrt wrote:
> It is an associative array internally. But they cannot be accessed as
> such from the templates.
>
> #foo#
>
> will display the value of:
>
> $this->_configs[0]['foo']
>
> We could supply a way to access the config file vars directly with
> $smarty.config.foo, although I don't know what that gains us, it is
> essentially the same as #foo#
>
> Monte
>
> On Tue, 2003-02-18 at 10:15, SavaJr wrote:
> > Well,
> > this is "almost that".
> >
> > I'm looking for hashes (associative arrays).
> >
> > Like arr = ("xx" => "yy", "xx2" => "yy2").
> >
> > Can this be done?
> >
> > ---------------
> > Ruslan Savchyshyn
> > http://www.MagneticOne.com/
> > Web development and design services
> >
> > -----Original Message-----
> > From: Monte Ohrt [mailto:monte@ispi.net]
> > Sent: Tuesday, February 18, 2003 4:59 PM
> > To: Ruslan Savchyshyn
> > Cc: Smarty General
> > Subject: Re: [SMARTY] Question or feature suggestion: Arrays(hashes?)
> > viaconfig files
> >
> >
> > make that $smarty->config_overwrite
> >
> > On Tue, 2003-02-18 at 08:55, Monte Ohrt wrote:
> > > yes. set $smarty->overwrite = false
> > >
> > > then make your config file like so:
> > >
> > > foo = val1
> > > foo = val2
> > > foo = val3
> > >
> > >
> > > Then in the template #foo# will be an array.
> > >
> > > Monte
> > >
> > > On Tue, 2003-02-18 at 08:47, Ruslan Savchyshyn wrote:
> > > > Hello
> > > >
> > > > I was unable to find - is this possible to have arrays via smarty
> > > > config files? I need to make 6-7 assigns before get page loaded.
> > > >
> > > > And don't want to have local request in each template.
> > > >
> > > > ---------------
> > > > Ruslan Savchyshyn
> > > > http://www.MagneticOne.com/
> > > > Web development and design services
> > > --
> > > Monte Ohrt <monte@ispi.net>
> > --
> > Monte Ohrt <monte@ispi.net>
> >
> >
> > --
> > Smarty General Mailing List (http://smarty.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> --
> Monte Ohrt <monte@ispi.net>
--
Monte Ohrt <monte@ispi.net>