Skip to content

HTMLPurifier_Printer_HTMLDefinition

Properties

def

protected $def

Methods

render

public render(\HTMLPurifier_Config $config): string

Parameters:

Parameter Type Description
$config \HTMLPurifier_Config

renderDoctype

Renders the Doctype table

protected renderDoctype(): string

renderEnvironment

Renders environment table, which is miscellaneous info

protected renderEnvironment(): string

renderContentSets

Renders the Content Sets table

protected renderContentSets(): string

renderInfo

Renders the Elements ($info) table

protected renderInfo(): string

renderChildren

Renders a row describing the allowed children of an element

protected renderChildren(\HTMLPurifier_ChildDef $def): string

Parameters:

Parameter Type Description
$def \HTMLPurifier_ChildDef HTMLPurifier_ChildDef of pertinent element

listifyTagLookup

Listifies a tag lookup table.

protected listifyTagLookup(array $array): string

Parameters:

Parameter Type Description
$array array Tag lookup array in form of array('tagname' => true)

listifyObjectList

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

protected listifyObjectList(array $array): string

Parameters:

Parameter Type Description
$array array List of objects

listifyAttr

Listifies a hash of attributes to AttrDef classes

protected listifyAttr(array $array): string

Parameters:

Parameter Type Description
$array array Array hash in form of array('attrname' => HTMLPurifier_AttrDef)

heavyHeader

Creates a heavy header row

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

Parameters:

Parameter Type Description
$text string
$num int

Inherited methods

__construct

Initialize $generator.

public __construct(): mixed

prepareGenerator

Give generator necessary configuration if possible

public prepareGenerator(\HTMLPurifier_Config $config): mixed

Parameters:

Parameter Type Description
$config \HTMLPurifier_Config

start

Returns a start tag

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

Parameters:

Parameter Type Description
$tag string Tag name
$attr array Attribute array

end

Returns an end tag

protected end(string $tag): string

Parameters:

Parameter Type Description
$tag string Tag name

element

Prints a complete element with content inside

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

Parameters:

Parameter Type Description
$tag string Tag name
$contents string Element contents
$attr array Tag attributes
$escape bool whether or not to escape contents

elementEmpty

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

Parameters:

Parameter Type Description
$tag string
$attr array

text

protected text(string $text): string

Parameters:

Parameter Type Description
$text string

row

Prints a simple key/value row in a table.

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

Parameters:

Parameter Type Description
$name string Key
$value mixed Value

escape

Escapes a string for HTML output.

protected escape(string $string): string

Parameters:

Parameter Type Description
$string string String to escape

listify

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

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

Parameters:

Parameter Type Description
$array string[] List of strings
$polite bool Bool whether or not to add an end before the last

getClass

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

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

Parameters:

Parameter Type Description
$obj object Object to determine class of
$sec_prefix string Further prefix to remove


Automatically generated on 2025-03-18