\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

Type

$_xhtml

$_xhtml : 

Whether or not generator should produce XML output.

Type

$_scriptFix

$_scriptFix : 

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

Type

$_def

$_def : 

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

Type

$_sortAttr

$_sortAttr : 

Cache of %Output.SortAttr.

Type

$_flashCompat

$_flashCompat : 

Cache of %Output.FlashCompat.

Type

$_innerHTMLFix

$_innerHTMLFix : 

Cache of %Output.FixInnerHTML.

Type

$_flashStack

$_flashStack : 

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

Type

Methods

generateFromTokens()

generateFromTokens(array<mixed,\HTMLPurifier_Token>  $tokens) : string

Generates HTML from an array of tokens.

Parameters

array<mixed,\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, integer  $quote = null) : string

Escapes raw text data.

Parameters

string $string

String data to escape for HTML.

integer $quote

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

Returns

string —

escaped data.