Re: [SMARTY] config file doesn't take an assigned variable

From: Date: Wed, 05 Jun 2002 13:30:26 +0000
Subject: Re: [SMARTY] config file doesn't take an assigned variable
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4617@lists.php.net to get a copy of this message
You have to apply the eval function so it gets evaluated as a template. The value of foo is: {$foo} The value of test is: {eval var=#test#} Read that man page again :-) Ubaldo Huerta wrote:
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?
-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.

« previous php.smarty.general (#4617) next »