config file doesn't take an assigned variable
| From: | Ubaldo Huerta | Date: | Wed, 05 Jun 2002 10:34:05 +0000 |
| Subject: | config file doesn't take an assigned variable | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-4610@lists.php.net to get a copy of this message | ||
The following manual page
(http://www.phpinsider.com/php/code/Smarty/docs/language.function.eval.h
tml)
suggests that you may use assigned variables in config files. However,
I'm observing something
different, that is, that assigned variables are only substituted in tpl
files, NOT in config files. Here is an example.
_test.conf
-----------
test = Won't get what I want for foo. Value is {$foo}.
test.tpl
-----------
{ config_load file=_test.conf }
The value of foo is: {$foo}
The value of test is: {#test#}
the code
----------
smarty = new Smarty;
$smarty->assign("foo", "bar");
$smarty->display("test.tpl");
the output
------------------------------------------------------------
The value of foo is: bar
The value of test is: Won't get what I want for foo. Value is {$foo}.
Notice that the value of assigned variable "foo" won't expand correctly
in the second line, which should read:
The value of test is: Won't get what I want for foo. Value is bar.
What gives?
Ubaldo
P.S. Do we finally have an official 'powered by smarty' gif?