Class HTMLPurifier_Printer

InheritanceHTMLPurifier_Printer
SubclassesHTMLPurifier_Printer_CSSDefinition, HTMLPurifier_Printer_ConfigForm, HTMLPurifier_Printer_ConfigForm_NullDecorator, HTMLPurifier_Printer_ConfigForm_bool, HTMLPurifier_Printer_ConfigForm_default, HTMLPurifier_Printer_HTMLDefinition

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$config For easy access. HTMLPurifier_Printer
$generator For HTML generation convenience funcs. HTMLPurifier_Printer

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Initialize $generator. HTMLPurifier_Printer
prepareGenerator() Give generator necessary configuration if possible HTMLPurifier_Printer

Protected Methods

Hide inherited methods

MethodDescriptionDefined 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

$config protected property
protected $config null
$generator protected property
protected $generator null

Method Details

__construct() public method

Initialize $generator.

public void __construct ( )
element() protected method

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

elementEmpty() protected method

protected string elementEmpty ( $tag, $attr = [] )
$tag string
$attr array
end() protected method

Returns an end tag

protected string end ( $tag )
$tag string

Tag name

escape() protected method

Escapes a string for HTML output.

protected string escape ( $string )
$string string

String to escape

getClass() protected method

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

listify() protected method

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

prepareGenerator() public method

Give generator necessary configuration if possible

public void prepareGenerator ( $config )
$config HTMLPurifier_Config
row() protected method

Prints a simple key/value row in a table.

protected string row ( $name, $value )
$name string

Key

$value mixed

Value

start() protected method

Returns a start tag

protected string start ( $tag, $attr = [] )
$tag string

Tag name

$attr array

Attribute array

text() protected method

protected string text ( $text )
$text string