Remove {unser} and add tests

This commit is contained in:
Ivan Shalganov
2013-09-15 16:05:18 +04:00
parent 7c038e0ba9
commit f9d9f098b7
7 changed files with 35 additions and 62 deletions

View File

@ -1028,23 +1028,4 @@ class Compiler
$scope->tpl->escape = $scope["escape"];
}
/**
* Unset present variables
*
* @param Tokenizer $tokens
* @param Template $tpl
* @return string
* @throws InvalidUsageException
*/
public static function tagUnset(Tokenizer $tokens, Template $tpl)
{
$vars = array();
while ($tokens->valid()) {
$vars[] = $tpl->parseVariable($tokens);
}
if (!$vars) {
throw new InvalidUsageException("Unset must accept variable(s)");
}
return 'unset(' . implode(', ', $vars) . ')';
}
}