Here's a simple example using the time to the second as a value to illustrate the issue.
A tag called {get_date}:
Code: Select all
//$smarty->caching=false;
$d = date("H:i:s");
echo "Inside get_date ($d) <br />";
$smarty->assign($params['var'], $d);
Code: Select all
Value before call:({$ret_val})<br />
{get_date var='ret_val'}
Value after call:({$ret_val})<br />
I tried toggling $smarty->caching, but the results are unpredictable. On some machines I get the desired behavior, on others I see {nocache} output in the page, and on others the tag gets called twice.Value before call:()
Inside get_date (10:54:10)
Value after call:(10:53:50)
All insight appreciated!
FYI, the actual code I'm trying to debug looks like this:
Code: Select all
$userid = get_userid(false);
$smarty->caching=false;
$smarty->assign($params['var'],(check_permission($userid, $params['name']) ? 1:0));