Evaluate Smarty output from a UDT (User Defined Tag)
Posted: Tue Oct 02, 2007 3:42 pm
I had the need to have smarty output evaluated from a User Defined Tag recently, and couldn't find anything searching the forums.
This is how I ended up doing it, there may be a better way.
This is how I ended up doing it, there may be a better way.
Code: Select all
global $gCms;
$smarty =& $gCms->GetSmarty();
$output = "Whatever...";
$output .= "{* Smarty tags will work. *}";
require_once $smarty->_get_plugin_filepath('function', 'eval');
echo smarty_function_eval(array('var' => $output), $smarty);