\HTMLPurifier_Generator

Generates HTML from tokens.

Summary

Methods
Properties
Constants
__construct()
generateFromTokens()
generateFromToken()
generateScriptFromToken()
generateAttributes()
escape()
No public properties found
No constants found
No protected methods found
$config
N/A
No private methods found
$_xhtml
$_scriptFix
$_def
$_sortAttr
$_flashCompat
$_innerHTMLFix
$_flashStack
N/A

Properties

$config

$config

Configuration for the generator

$_xhtml

$_xhtml

Whether or not generator should produce XML output.

$_scriptFix

$_scriptFix

:HACK: Whether or not generator should comment the insides of <script> tags.

$_def

$_def

Cache of HTMLDefinition during HTML output to determine whether or not attributes should be minimized.

$_sortAttr

$_sortAttr

Cache of %Output.SortAttr.

$_flashCompat

$_flashCompat

Cache of %Output.FlashCompat.

$_innerHTMLFix

$_innerHTMLFix

Cache of %Output.FixInnerHTML.

$_flashStack

$_flashStack

Stack for keeping track of object information when outputting IE compatibility code.

Methods

__construct()

__construct(\HTMLPurifier_Config  $config, \HTMLPurifier_Context  $context) : mixed

Parameters

\HTMLPurifier_Config $config
\HTMLPurifier_Context $context

Returns

mixed —

generateFromTokens()

generateFromTokens(\HTMLPurifier_Token[]  $tokens) : string

Generates HTML from an array of tokens.

Parameters

\HTMLPurifier_Token[] $tokens

Array of HTMLPurifier_Token

Returns

string —

Generated HTML

generateFromToken()

generateFromToken(\HTMLPurifier_Token  $token) : string

Generates HTML from a single token.

Parameters

\HTMLPurifier_Token $token

HTMLPurifier_Token object.

Returns

string —

Generated HTML

generateScriptFromToken()

generateScriptFromToken(\HTMLPurifier_Token  $token) : string

Special case processor for the contents of script tags

Parameters

\HTMLPurifier_Token $token

HTMLPurifier_Token object.

Returns

string —

generateAttributes()

generateAttributes(array  $assoc_array_of_attributes, string  $element = '') : string

Generates attribute declarations from attribute array.

Parameters

array $assoc_array_of_attributes

Attribute array

string $element

Name of element attributes are for, used to check attribute minimization.

Returns

string —

Generated HTML fragment for insertion.

escape()

escape(string  $string, int  $quote = null) : string

Escapes raw text data.

Parameters

string $string

String data to escape for HTML.

int $quote

Quoting style, like htmlspecialchars. ENT_NOQUOTES is permissible for non-attribute output.

Returns

string —

escaped data.