Re: defining arrays in config files

"Tarik ANSARI" <[email protected]>
Newsgroups gmane.comp.php.smarty.devel
Message-ID <[email protected]>
Ok, well, my fears are confirmed then... how can a template system miss this
?!
Then I think that Smarty should be improved on that points : we should be
able to work with the same variables definitions rules and syntax in config
files as in templates, or at less have the same possibilities. In reality
the problem is not that the config var works as constants, this is well and
understandable, exept that we should be able to define a constant that is
the concatenation of a string and a var that comes from the php stript for
example.
In my case the aim was to define strings like that in config files :

errmsg[$smarty.const.NotFound] = "file not found"

where NotFound is an errno from php script

As I designed my project to run with the Smarty template engine, I think
that I should help to improve it if I want to keep my objectives. Then I am
ready to help the Smarty team on improving this section of smarty code. As
it is working with CVS, all I have to do is to make my improvements to the
code and submit it for approvement ?

Tarik

Messju Mohr wrote:
> On Sun, Feb 22, 2004 at 10:47:47AM +0100, Tarik ANSARI wrote:
> > Hello,
> >
> > I would like to ask something I ever asked on php.smary.general, but
without
> > getting any accurate answer, I think it should better be asked here :
> >
> > 1) Is it possible to define arrays in config files ? How to do it ?
>
> It is possible but very limited: you can set $smarty->config_overwrite
> to false. Two or more config-variables with the same name in a
> config-file are grouped together to an array, then.
>
> > 2) How to concatenate a string with a variable like $smarty.const.CONST
in a
> > config file ?
>
> You can't right now. All contents of config-files are static.
>
> > I ask all this questions because I would not like to use the header of
my
> > tpl to define what should be done in the config file...
> > Thank you

-- 
Smarty Development Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.