\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.

Type

$config

$config : 

For easy access.

Type

$fields

$fields : 

Printers for specific fields.

Type

$docURL

$docURL : 

Documentation URL, can have fragment tagged on end.

Type

$name

$name : 

Name of form element to stuff config in.

Type

$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.

Type

Methods

__construct()

__construct(string  $name, string  $doc_url = null, boolean  $compress = false) 

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

boolean $compress

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

prepareGenerator()

prepareGenerator(\HTMLPurifier_Config  $config) 

Give generator necessary configuration if possible

Parameters

\HTMLPurifier_Config $config

setTextareaDimensions()

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

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

getCSS()

getCSS() 

Retrieves styling, in case it is not accessible by webserver

getJavaScript()

getJavaScript() 

Retrieves JavaScript, in case it is not accessible by webserver

render()

render(\HTMLPurifier_Config|array  $config, array|boolean  $allowed = true, boolean  $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|boolean $allowed

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

boolean $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(), boolean  $escape = true) : string

Prints a complete element with content inside

Parameters

string $tag

Tag name

string $contents

Element contents

array $attr

Tag attributes

boolean $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(array<mixed,string>  $array, boolean  $polite = false) : string

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

Parameters

array<mixed,string> $array

List of strings

boolean $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