Re: [SMARTY] problem with config vars

From: Date: Sun, 06 Apr 2003 07:43:41 +0000
Subject: Re: [SMARTY] problem with config vars
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-9139@lists.php.net to get a copy of this message
On Sat, Apr 05, 2003 at 11:53:51PM +0200, Tom Sommer wrote: > I got a small problem with template vars embedded in config vars > > I got this as a config var > var1 = '<img src="{$THEME_PATH}images/bullet.jpg">' > > then I assign var1 in PHP by doing this > > $smarty->assign('test', make_link('test.php', > $smarty->get_config_vars('var1') ); > (without the wrap) > > It should then be obvious that {$THEME_PATH} is not replaced by the value > of that var, how do I solve this? > > eval does not work on the php level > > perhaps a $smary->eval() ? require $smarty->_get_plugin_filepath('function', 'eval'); smarty_function_eval(array('var'=>$str), $smarty)); that's what smarty does if it encounters an eval. _get_plugin_filepath is considered internal, so use it with care or require the eval-plugin in another way. greetings messju

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