Properties

$generator

$generator

For HTML generation convenience funcs.

$config

$config

For easy access.

$def

$def

Methods

__construct()

__construct() : mixed

Initialize $generator.

Returns

mixed —

prepareGenerator()

prepareGenerator(\HTMLPurifier_Config  $config) : mixed

Give generator necessary configuration if possible

Parameters

\HTMLPurifier_Config $config

Returns

mixed —

render()

render(\HTMLPurifier_Config  $config) : string

Parameters

\HTMLPurifier_Config $config

Returns

string —

start()

start(string  $tag, array  $attr = array()) : string

Returns a start tag

Parameters

string $tag

Tag name

array $attr

Attribute array

Returns

string —

end()

end(string  $tag) : string

Returns an end tag

Parameters

string $tag

Tag name

Returns

string —

element()

element(string  $tag, string  $contents, array  $attr = array(), bool  $escape = true) : string

Prints a complete element with content inside

Parameters

string $tag

Tag name

string $contents

Element contents

array $attr

Tag attributes

bool $escape

whether or not to escape contents

Returns

string —

elementEmpty()

elementEmpty(string  $tag, array  $attr = array()) : string

Parameters

string $tag
array $attr

Returns

string —

text()

text(string  $text) : string

Parameters

string $text

Returns

string —

row()

row(string  $name, mixed  $value) : string

Prints a simple key/value row in a table.

Parameters

string $name

Key

mixed $value

Value

Returns

string —

escape()

escape(string  $string) : string

Escapes a string for HTML output.

Parameters

string $string

String to escape

Returns

string —

listify()

listify(string[]  $array, bool  $polite = false) : string

Takes a list of strings and turns them into a single list

Parameters

string[] $array

List of strings

bool $polite

Bool whether or not to add an end before the last

Returns

string —

getClass()

getClass(object  $obj, string  $sec_prefix = '') : string

Retrieves the class of an object without prefixes, as well as metadata

Parameters

object $obj

Object to determine class of

string $sec_prefix

Further prefix to remove

Returns

string —

renderDoctype()

renderDoctype() : string

Renders the Doctype table

Returns

string —

renderEnvironment()

renderEnvironment() : string

Renders environment table, which is miscellaneous info

Returns

string —

renderContentSets()

renderContentSets() : string

Renders the Content Sets table

Returns

string —

renderInfo()

renderInfo() : string

Renders the Elements ($info) table

Returns

string —

renderChildren()

renderChildren(\HTMLPurifier_ChildDef  $def) : string

Renders a row describing the allowed children of an element

Parameters

\HTMLPurifier_ChildDef $def

HTMLPurifier_ChildDef of pertinent element

Returns

string —

listifyTagLookup()

listifyTagLookup(array  $array) : string

Listifies a tag lookup table.

Parameters

array $array

Tag lookup array in form of array('tagname' => true)

Returns

string —

listifyObjectList()

listifyObjectList(array  $array) : string

Listifies a list of objects by retrieving class names and internal state

Parameters

array $array

List of objects

Returns

string —

listifyAttr()

listifyAttr(array  $array) : string

Listifies a hash of attributes to AttrDef classes

Parameters

array $array

Array hash in form of array('attrname' => HTMLPurifier_AttrDef)

Returns

string —

heavyHeader()

heavyHeader(string  $text, int  $num = 1) : string

Creates a heavy header row

Parameters

string $text
int $num

Returns

string —