RE: [SMARTY] Question or feature suggestion: Arrays(hashes?)viaconfig files
| From: | SavaJr | Date: | Tue, 18 Feb 2003 17:00:50 +0000 |
| Subject: | RE: [SMARTY] Question or feature suggestion: Arrays(hashes?)viaconfig files | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7835@lists.php.net to get a copy of this message | ||
Ok, thanks Monte
Possibly it makes sense for me to add some method to local inherited
class like "assignMultiple" and assign MANY hashes at once - Foreach
assign usage - Instead of overcomplicating smarty.
Like
Function assignMultiple($arr = Array()) {
foreach ($arr as $key => $val) {
$this->assign($val);
}
}
Just a workaround that works for now, code seems better, but this line
still overcomplicated bit (with many parameters).
---------------
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 6:41 PM
To: savajr@avalon.te.ua
Cc: Smarty General
Subject: RE: [SMARTY] Question or feature suggestion:
Arrays(hashes?)viaconfig files
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>
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php