\HTMLPurifier_Printer_ConfigForm

Summary

Methods
Properties
Constants
__construct()
prepareGenerator()
setTextareaDimensions()
getCSS()
getJavaScript()
render()
No public properties found
No constants found
start()
end()
element()
elementEmpty()
text()
row()
escape()
listify()
getClass()
renderNamespace()
$generator
$config
$fields
$docURL
$name
$compress
N/A
No private methods found
No private properties found
N/A

Properties

$generator

$generator

For HTML generation convenience funcs.

$config

$config

For easy access.

$fields

$fields

Printers for specific fields.

$docURL

$docURL

Documentation URL, can have fragment tagged on end.

$name

$name

Name of form element to stuff config in.

$compress

$compress

Whether or not to compress directive names, clipping them off after a certain amount of letters. False to disable or integer letters before clipping.

Methods

__construct()

__construct(string  $name, string  $doc_url = null, bool  $compress = false) : mixed

Initialize $generator.

Parameters

string $name

Form element name for directives to be stuffed into

string $doc_url

String documentation URL, will have fragment tagged on

bool $compress

Integer max length before compressing a directive name, set to false to turn off

Returns

mixed —

prepareGenerator()

prepareGenerator(\HTMLPurifier_Config  $config) : mixed

Give generator necessary configuration if possible

Parameters

\HTMLPurifier_Config $config

Returns

mixed —

setTextareaDimensions()

setTextareaDimensions( $cols = null,  $rows = null) : mixed

Sets default column and row size for textareas in sub-printers

Parameters

$cols

Integer columns of textarea, null to use default

$rows

Integer rows of textarea, null to use default

Returns

mixed —

getCSS()

getCSS() : mixed

Retrieves styling, in case it is not accessible by webserver

Returns

mixed —

getJavaScript()

getJavaScript() : mixed

Retrieves JavaScript, in case it is not accessible by webserver

Returns

mixed —

render()

render(\HTMLPurifier_Config|array  $config, array|bool  $allowed = true, bool  $render_controls = true) : string

Returns HTML output for a configuration form

Parameters

\HTMLPurifier_Config|array $config

Configuration object of current form state, or an array where [0] has an HTML namespace and [1] is being rendered.

array|bool $allowed

Optional namespace(s) and directives to restrict form to.

bool $render_controls

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 —

renderNamespace()

renderNamespace( $ns, array  $directives) : string

Renders a single namespace

Parameters

$ns

String namespace name

array $directives

array of directives to values

Returns

string —