Smarty validation class
This is a class used to validate a Smarty template. It basically just runs the normal Smarty parser, trapping all the errors then returning them in array.
Very useful for a web-based template editor.
This class requires Smarty to be installed.
validateTemplate(’mytemplate.tpl’);
var_dump($errors);
if (count($errors) == 0)
; // no errors
else
; // 1 or more errors occurred
?>
Also, you can optionally validate resources to see if they exist. For example, if you have something like:
{include file=’another.tpl’}
Then if you pass the validateResources option as true to the validateTemplate() method, it will make sure that another.tpl exists.
