TemplateLoader
abstract class TemplateLoader
Constants
XMLNS_XSL |
XSL namespace |
Methods
Load a template as an xsl:template node
Serialize a loaded template back into a string
Replace HTML entities and unescaped ampersands in given template
Load given HTML template in a DOM document
Load given XSL template in a DOM document
Remove attributes with an invalid name from given DOM document
Replace CDATA sections in given template
Replace known HTML entities
Details
at line 50
static Document
load(string $template)
Load a template as an xsl:template node
Will attempt to load it as XML first, then as HTML as a fallback. Either way, an xsl:template node is returned
at line 77
static string
save(Document $dom)
Serialize a loaded template back into a string
NOTE: removes the root node created by load()
at line 94
static protected string
fixEntities(string $template)
Replace HTML entities and unescaped ampersands in given template
at line 108
static protected Document
loadAsHTML(string $template)
Load given HTML template in a DOM document
at line 137
static protected Document
loadAsXML(string $template)
Load given XSL template in a DOM document
at line 156
static protected void
removeInvalidAttributes(Document $dom)
Remove attributes with an invalid name from given DOM document
at line 174
static protected string
replaceCDATA(string $template)
Replace CDATA sections in given template
at line 192
static protected string
replaceEntities(string $template)
Replace known HTML entities