Add Loader::isValid method used to check for SyntaxErrors in templates