Class HTMLPurifier_Generator
Inheritance | HTMLPurifier_Generator |
---|
Generates HTML from tokens.
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$config | Configuration for the generator | HTMLPurifier_Generator |
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | HTMLPurifier_Generator | |
escape() | Escapes raw text data. | HTMLPurifier_Generator |
generateAttributes() | Generates attribute declarations from attribute array. | HTMLPurifier_Generator |
generateFromToken() | Generates HTML from a single token. | HTMLPurifier_Generator |
generateFromTokens() | Generates HTML from an array of tokens. | HTMLPurifier_Generator |
generateScriptFromToken() | Special case processor for the contents of script tags | HTMLPurifier_Generator |
Property Details
Method Details
public void __construct ( $config, $context ) | ||
$config | HTMLPurifier_Config | |
$context | HTMLPurifier_Context |
Escapes raw text data.
public string escape ( $string, $quote = null ) | ||
$string | string | String data to escape for HTML. |
$quote | int | Quoting style, like htmlspecialchars. ENT_NOQUOTES is
|
return | string | Escaped data. |
---|
Generates attribute declarations from attribute array.
public string generateAttributes ( $assoc_array_of_attributes, $element = '' ) | ||
$assoc_array_of_attributes | array | Attribute array |
$element | string | Name of element attributes are for, used to check
|
return | string | Generated HTML fragment for insertion. |
---|
Generates HTML from a single token.
public string generateFromToken ( $token ) | ||
$token | HTMLPurifier_Token | HTMLPurifier_Token object. |
return | string | Generated HTML |
---|
Generates HTML from an array of tokens.
public string generateFromTokens ( $tokens ) | ||
$tokens | HTMLPurifier_Token[] | Array of HTMLPurifier_Token |
return | string | Generated HTML |
---|
Special case processor for the contents of script tags
public string generateScriptFromToken ( $token ) | ||
$token | HTMLPurifier_Token | HTMLPurifier_Token object. |