Re: Smarty config files
| From: | Monte Ohrt | Date: | Wed, 23 May 2001 16:55:06 +0000 |
| Subject: | Re: Smarty config files | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-798@lists.php.net to get a copy of this message | ||
The entire config_file is fed into memory the first time it is accessed.
After that, if the config file is loaded again (to access a particular
section for example) the memory array is used instead of re-parsing the
file. This entire process happens on each invocation of Smarty.
Mike Krus wrote:
>
> Hi,
>
> I have been using Smarty for a few weeks now and I am very pleased
> with it! However, I have a question regarding config files:
>
> I use a config file to hold language specific strings, so
> I assign a variable with name of config file which is appropriate
> for the user's settings and in the template do:
> {config_load file=$LANGFILE}
>
> This works fine except:
> - I have to do load the config file also in the templates which are
> included in the top most template:
> . Is the config file actually parsed every time it is loaded
> in templates or sub-templates?
> . Is there a way to avoid this?
> . Can config data be passed to sub-templates without having
> to reload the config file every time?
> - I currently have all language strings in a single config
> file but it's getting quite huge. It would be better to have
> a file for each template or bunch of templates. So I would
> like to set a template var to $SITELANG and do:
> {config_load file="somecfgfile.$SITELANG.cfg"}
> but this does not seem to work. Any ideas on how I could
> get something like this to work?
>
> Thanks,
>
> Mike
>
> ---
> You are currently subscribed to smarty as: monte@ispi.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/