class PHP implements RendererInterface

Plain PHP view renderer.

Traits

Escaper trait.

Properties

protected array $htmlNamedEntityMap HTML entity map. from EscaperTrait

Methods

string
escapeHTML(string|null $string, string $charset, bool $doubleEncode = true)

Returns a string that has been escaped for a HTML body context.

string
escapeURL(string|null $string)

Returns a string that has been escaped for a URI or parameter context.

string
attributeEscaper(array $matches)

Escapes characters for use in a HTML attribute context.

string
escapeAttribute(string|null $string, string $charset)

Returns a string that has been escaped for a HTML attribute context.

string
cssEscaper(array $matches)

Escapes characters for use in a CSS context.

string
escapeCSS(string|null $string, string $charset)

Returns a string that has been escaped for a CSS context.

string
javascriptEscaper(array $matches)

Escapes characters for use in a Javascript context.

string
escapeJavascript(string|null $string, string $charset)

Returns a string that has been escaped for a Javascript context.

string
render(string $__view__, array $__variables__)

Returns the rendered view.

Details

in EscaperTrait at line 53
string escapeHTML(string|null $string, string $charset, bool $doubleEncode = true)

Returns a string that has been escaped for a HTML body context.

Parameters

string|null $string String to escape
string $charset Character set
bool $doubleEncode Should existing entities be encoded?

Return Value

string

in EscaperTrait at line 64
string escapeURL(string|null $string)

Returns a string that has been escaped for a URI or parameter context.

Parameters

string|null $string String to escape

Return Value

string

in EscaperTrait at line 77
protected string attributeEscaper(array $matches)

Escapes characters for use in a HTML attribute context.

(This method contains code from the SecurityMultiTool library).

Parameters

array $matches Regex matches

Return Value

string

in EscaperTrait at line 126
string escapeAttribute(string|null $string, string $charset)

Returns a string that has been escaped for a HTML attribute context.

Parameters

string|null $string String to escape
string $charset Character set

Return Value

string

in EscaperTrait at line 151
protected string cssEscaper(array $matches)

Escapes characters for use in a CSS context.

(This method contains code from the SecurityMultiTool library).

Parameters

array $matches Regex matches

Return Value

string

in EscaperTrait at line 176
string escapeCSS(string|null $string, string $charset)

Returns a string that has been escaped for a CSS context.

Parameters

string|null $string String to escape
string $charset Character set

Return Value

string

in EscaperTrait at line 206
protected string javascriptEscaper(array $matches)

Escapes characters for use in a Javascript context.

(This method contains code from the SecurityMultiTool library).

Parameters

array $matches Regex matches

Return Value

string

in EscaperTrait at line 227
string escapeJavascript(string|null $string, string $charset)

Returns a string that has been escaped for a Javascript context.

Parameters

string|null $string String to escape
string $charset Character set

Return Value

string

at line 28
string render(string $__view__, array $__variables__)

Returns the rendered view.

Parameters

string $__view__ View path
array $__variables__ View variables

Return Value

string