Discussion:
[SMARTY] config variables in scripts and templates
Paul Lockaby
2003-02-20 01:05:50 UTC
Permalink
Hi,

Is it possible to create a publicly accessible array of config file
variables to the php script? What I mean by that is this. When you load
a config file, like so:

$smarty->config_load("settings.cfg");

I want to be able to then access those variables from my script, without
having to load either load up the config files by creating an instance
of Config_Load or by accessing the private _config[0]["vars"] array.
Likewise, I feel that there should also be access to the assigned
variables through a mechanism other than _tpl_vars, a mechanism that
isn't me just bypassing the program.

Just my two cents.

~Paul
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Laurent Penou
2003-02-20 01:21:12 UTC
Permalink
Hello

Prior to the new releases this was workin

PHP : $smarty->assign("ajout","ajout0");
TPL : {include file="zannonces/$ajout.tpl"}

Now it's not working any more as expected
I could use this work arroud

TPL : {if $ajout eq "ajout0"}
{include file="zannonces/ajout0.tpl"}
{elseif $ajout eq "ajout1"}
{include file="zannonces/$ajout1.tpl"}
{/if}

But thats painfull

Any ideas ?
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Paul Lockaby
2003-02-20 02:04:28 UTC
Permalink
Post by Laurent Penou
Hello
Prior to the new releases this was workin
PHP : $smarty->assign("ajout","ajout0");
TPL : {include file="zannonces/$ajout.tpl"}
Now it's not working any more as expected
I could use this work arroud
TPL : {if $ajout eq "ajout0"}
{include file="zannonces/ajout0.tpl"}
{elseif $ajout eq "ajout1"}
{include file="zannonces/$ajout1.tpl"}
{/if}
But thats painfull
Any ideas ?
This question was answered yesterday in this thread:

http://marc.theaimsgroup.com/?l=smarty-general&m=104562338914529&w=2

Also, please do not ask a question by replying to someone else's
question. It messes up messages threading. :)

~Paul
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Loading...