Request: arrays in config files and/or variables export from included template
| From: | Konstantin | Date: | Tue, 12 Nov 2002 16:26:34 +0000 |
| Subject: | Request: arrays in config files and/or variables export from included template | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-331@lists.php.net to get a copy of this message | ||
The site I'm working on should have a menu and a title on
every page, and titles in menu and on pages should be the
same.
It's obvious, that I want to take that strings from the
same array (associative, indexes are internal IDs).
I can assign() it from the script, but I have two reasons
to want array definition to be placed at template level:
1. I want my scripts to be language-independent
2. I want Smarty caches to be regenerated after changing
menu strings
It seems to me, the best place for the definition of such
an array is a template config file, but I cannot see a way
to define an array there. So, I need a way.
Another way, I could write an external function to define
that array in a template, but I want array definition to be
separate from main templates, and I see that it becomes
local and invisible for top-level template. So, I need an
"export" template function or {include} parameter, or other
way to pass a complex (non-scalar) variable to higher level
template.
With best regards,
Konstantin A. Pelepelin