RE: [SMARTY-DEV] RE: config_load API
| From: | Gerard | Date: | Mon, 09 Dec 2002 20:46:13 +0000 |
| Subject: | RE: [SMARTY-DEV] RE: config_load API | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-394@lists.php.net to get a copy of this message | ||
I meant using {config_load} from templates. Otherwise all other configs
loaded from other templates and the API would be available (and could result
in collisions if var names are the same). Not sure what'd be best - use only
those configs specified by the particular template if "exclusive" is enabled
(and keep previously loaded configs loaded, but just don't use them for
*this* template). Anyhow, just a potential problem that struck me (I'll
probably only use the API config_load() though :)).
Gerard
> -----Original Message-----
> From: Monte Ohrt [mailto:monte@ispi.net]
> Sent: Monday, December 09, 2002 1:36 PM
> To: Gerard
> Cc: smarty-dev@lists.php.net
> Subject: Re: [SMARTY-DEV] RE: config_load API
>
>
> When you use config_load() from the API, there is no template. You're
> just loading vars into global space. Is that what you meant?
>
> On Mon, 2002-12-09 at 14:31, Gerard wrote:
> > Just a thought :)
> >
> > Maybe an 'exclusive' attribute (or something) is needed for
> {config_load} if
> > people want to use *only* the config(s) loaded by that template.
> >
> > I like config_load() :)
> >
> > Gerard
> > gerard@interfold.com
> >
> >
> >
> > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> >
> > I'm working on adding the config_load API function, and I see that the
> > assigned config array is wiped clean any time fetch() or display() is
> > called. Does anyone see a problem with removing that behavior?
> >
> > For example:
> >
> > $smarty->config_load('foo.conf');
> > $smarty->fetch('1.tpl');
> > $smarty->fetch('2.tpl');
> > $smarty->fetch('3.tpl');
> >
> > Whatever was loaded from foo.conf should be retained thereafter, not
> > wiped out by calling fetch(). However, {config_load ...} calls from
> > within the templates could affect the loaded variables.
> >
> > Monte
> --
> Monte Ohrt <monte@ispi.net>
>
>