Class HTMLPurifier_Printer
Protected Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $config | For easy access. | HTMLPurifier_Printer | |
| $generator | For HTML generation convenience funcs. | HTMLPurifier_Printer |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Initialize $generator. | HTMLPurifier_Printer |
| prepareGenerator() | Give generator necessary configuration if possible | HTMLPurifier_Printer |
Protected Methods
| Method | Description | Defined By |
|---|---|---|
| element() | Prints a complete element with content inside | HTMLPurifier_Printer |
| elementEmpty() | HTMLPurifier_Printer | |
| end() | Returns an end tag | HTMLPurifier_Printer |
| escape() | Escapes a string for HTML output. | HTMLPurifier_Printer |
| getClass() | Retrieves the class of an object without prefixes, as well as metadata | HTMLPurifier_Printer |
| listify() | Takes a list of strings and turns them into a single list | HTMLPurifier_Printer |
| row() | Prints a simple key/value row in a table. | HTMLPurifier_Printer |
| start() | Returns a start tag | HTMLPurifier_Printer |
| text() | HTMLPurifier_Printer |
Property Details
Method Details
Initialize $generator.
| public void __construct ( ) |
Prints a complete element with content inside
| protected string element ( $tag, $contents, $attr = [], $escape = true ) | ||
| $tag | string | Tag name |
| $contents | string | Element contents |
| $attr | array | Tag attributes |
| $escape | bool | Whether or not to escape contents |
| protected string elementEmpty ( $tag, $attr = [] ) | ||
| $tag | string | |
| $attr | array | |
Returns an end tag
| protected string end ( $tag ) | ||
| $tag | string | Tag name |
Escapes a string for HTML output.
| protected string escape ( $string ) | ||
| $string | string | String to escape |
Retrieves the class of an object without prefixes, as well as metadata
| protected string getClass ( $obj, $sec_prefix = '' ) | ||
| $obj | object | Object to determine class of |
| $sec_prefix | string | Further prefix to remove |
Takes a list of strings and turns them into a single list
| protected string listify ( $array, $polite = false ) | ||
| $array | string[] | List of strings |
| $polite | bool | Bool whether or not to add an end before the last |
Give generator necessary configuration if possible
| public void prepareGenerator ( $config ) | ||
| $config | HTMLPurifier_Config | |
Prints a simple key/value row in a table.
| protected string row ( $name, $value ) | ||
| $name | string | Key |
| $value | mixed | Value |
Returns a start tag
| protected string start ( $tag, $attr = [] ) | ||
| $tag | string | Tag name |
| $attr | array | Attribute array |
| protected string text ( $text ) | ||
| $text | string | |