HTMLPurifier_Generator
in package
Generates HTML from tokens.
Tags
Table of Contents
Properties
- $config : mixed
- Configuration for the generator
- $_def : mixed
- Cache of HTMLDefinition during HTML output to determine whether or not attributes should be minimized.
- $_flashCompat : mixed
- Cache of %Output.FlashCompat.
- $_flashStack : mixed
- Stack for keeping track of object information when outputting IE compatibility code.
- $_innerHTMLFix : mixed
- Cache of %Output.FixInnerHTML.
- $_scriptFix : mixed
- :HACK: Whether or not generator should comment the insides of <script> tags.
- $_sortAttr : mixed
- Cache of %Output.SortAttr.
- $_xhtml : mixed
- Whether or not generator should produce XML output.
Methods
- __construct() : mixed
- escape() : string
- Escapes raw text data.
- generateAttributes() : string
- Generates attribute declarations from attribute array.
- generateFromToken() : string
- Generates HTML from a single token.
- generateFromTokens() : string
- Generates HTML from an array of tokens.
- generateScriptFromToken() : string
- Special case processor for the contents of script tags
Properties
$config
Configuration for the generator
protected
mixed
$config
Tags
$_def
Cache of HTMLDefinition during HTML output to determine whether or not attributes should be minimized.
private
mixed
$_def
Tags
$_flashCompat
Cache of %Output.FlashCompat.
private
mixed
$_flashCompat
Tags
$_flashStack
Stack for keeping track of object information when outputting IE compatibility code.
private
mixed
$_flashStack
= array()
Tags
$_innerHTMLFix
Cache of %Output.FixInnerHTML.
private
mixed
$_innerHTMLFix
Tags
$_scriptFix
:HACK: Whether or not generator should comment the insides of <script> tags.
private
mixed
$_scriptFix
= \false
Tags
$_sortAttr
Cache of %Output.SortAttr.
private
mixed
$_sortAttr
Tags
$_xhtml
Whether or not generator should produce XML output.
private
mixed
$_xhtml
= \true
Tags
Methods
__construct()
public
__construct(HTMLPurifier_Config $config, HTMLPurifier_Context $context) : mixed
Parameters
- $config : HTMLPurifier_Config
- $context : HTMLPurifier_Context
escape()
Escapes raw text data.
public
escape(string $string[, int $quote = null ]) : string
Parameters
- $string : string
-
String data to escape for HTML.
- $quote : int = null
-
Quoting style, like htmlspecialchars. ENT_NOQUOTES is permissible for non-attribute output.
Tags
Return values
string —escaped data.
generateAttributes()
Generates attribute declarations from attribute array.
public
generateAttributes(array<string|int, mixed> $assoc_array_of_attributes[, string $element = '' ]) : string
Parameters
- $assoc_array_of_attributes : array<string|int, mixed>
-
Attribute array
- $element : string = ''
-
Name of element attributes are for, used to check attribute minimization.
Tags
Return values
string —Generated HTML fragment for insertion.
generateFromToken()
Generates HTML from a single token.
public
generateFromToken(HTMLPurifier_Token $token) : string
Parameters
- $token : HTMLPurifier_Token
-
HTMLPurifier_Token object.
Return values
string —Generated HTML
generateFromTokens()
Generates HTML from an array of tokens.
public
generateFromTokens(array<string|int, HTMLPurifier_Token> $tokens) : string
Parameters
- $tokens : array<string|int, HTMLPurifier_Token>
-
Array of HTMLPurifier_Token
Return values
string —Generated HTML
generateScriptFromToken()
Special case processor for the contents of script tags
public
generateScriptFromToken(HTMLPurifier_Token $token) : string
Parameters
- $token : HTMLPurifier_Token
-
HTMLPurifier_Token object.