Generates HTML from tokens.
- Todo:
Refactor interface so that configuration/context is determined upon instantiation, no need for messy generateFromTokens() calls
Make some of the more internal functions protected, and have unit tests work around that
◆ __construct()
__construct |
( |
|
$config, |
|
|
|
$context |
|
) |
| |
◆ escape()
escape |
( |
|
$string, |
|
|
|
$quote = null |
|
) |
| |
Escapes raw text data.
- Todo:
- This really ought to be protected, but until we have a facility for properly generating HTML here w/o using tokens, it stays public.
- 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.
◆ generateAttributes()
generateAttributes |
( |
|
$assoc_array_of_attributes, |
|
|
|
$element = '' |
|
) |
| |
Generates attribute declarations from attribute array.
- Note
- This does not include the leading or trailing space.
- 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.
◆ generateFromToken()
generateFromToken |
( |
|
$token | ) |
|
Generates HTML from a single token.
- Parameters
-
- Returns
- string Generated HTML
◆ generateFromTokens()
generateFromTokens |
( |
|
$tokens | ) |
|
Generates HTML from an array of tokens.
- Parameters
-
- Returns
- string Generated HTML
◆ generateScriptFromToken()
generateScriptFromToken |
( |
|
$token | ) |
|
Special case processor for the contents of script tags
- Parameters
-
- Returns
- string
- Warning
- This runs into problems if there's already a literal --> somewhere inside the script contents.
◆ $config
The documentation for this class was generated from the following file:
- C:/xoops2511b2/htdocs/xoops_lib/modules/protector/library/HTMLPurifier/Generator.php