Template
class Template extends PHP
Mako template view renderer.
Traits
Properties
protected array | $htmlNamedEntityMap | HTML entity map. | from EscaperTrait |
protected FileSystem | $fileSystem | File system instance. | |
protected string | $cachePath | Cache path. | |
protected array | $blocks | Template blocks. | |
protected array | $openBlocks | Open template blocks. |
Methods
Returns a string that has been escaped for a HTML body context.
Returns a string that has been escaped for a URI or parameter context.
Escapes characters for use in a HTML attribute context.
Returns a string that has been escaped for a HTML attribute context.
Returns a string that has been escaped for a CSS context.
Escapes characters for use in a Javascript context.
Returns a string that has been escaped for a Javascript context.
Returns the rendered view.
Returns the path to the compiled template.
Returns TRUE if the template needs to be compiled and FALSE if not.
Compiles view.
Opens a template block.
Closes a template block.
Output a template block.
Details
in EscaperTrait at line 50
string
escapeHTML(string|null $string, string $charset, bool $doubleEncode = true)
Returns a string that has been escaped for a HTML body context.
in EscaperTrait at line 61
string
escapeURL(string|null $string)
Returns a string that has been escaped for a URI or parameter context.
in EscaperTrait at line 74
protected string
attributeEscaper(array $matches)
Escapes characters for use in a HTML attribute context.
(This method contains code from the SecurityMultiTool library).
in EscaperTrait at line 123
string
escapeAttribute(string|null $string, string $charset)
Returns a string that has been escaped for a HTML attribute context.
in EscaperTrait at line 148
protected string
cssEscaper(array $matches)
Escapes characters for use in a CSS context.
(This method contains code from the SecurityMultiTool library).
in EscaperTrait at line 173
string
escapeCSS(string|null $string, string $charset)
Returns a string that has been escaped for a CSS context.
in EscaperTrait at line 203
protected string
javascriptEscaper(array $matches)
Escapes characters for use in a Javascript context.
(This method contains code from the SecurityMultiTool library).
in EscaperTrait at line 224
string
escapeJavascript(string|null $string, string $charset)
Returns a string that has been escaped for a Javascript context.
at line 143
string
render(string $__view__, array $__variables__)
Returns the rendered view.
at line 60
__construct(FileSystem $fileSystem, string $cachePath)
Constructor.
at line 72
protected string
getCompiledPath(string $view)
Returns the path to the compiled template.
at line 84
protected bool
needToCompile(string $view, string $compiled)
Returns TRUE if the template needs to be compiled and FALSE if not.
at line 94
protected
compile(string $view)
Compiles view.
at line 104
open(string $name)
Opens a template block.
at line 114
string
close()
Closes a template block.
at line 124
output(string $name)
Output a template block.