UDT to totally remove a variable
Posted: Wed Aug 20, 2014 10:55 am
I needed to remove a smarty assigned variable in some template logic - not just set its value to null. There is no plugin in CMSMS, at least to my knowledge, to do it. Solution was to create a UDT called 'clear_var'.
UDT:
and in my template:
This completely erased the variable, not just the assigned value.
UDT:
Code: Select all
$smarty->clearAssign($params['var']);
Code: Select all
{clear_var var='myvar'}