HumHub Documentation (unofficial)

HTMLPurifier_ChildDef_Optional extends HTMLPurifier_ChildDef_Required
in package

Definition that allows a set of elements, and allows no children.

Tags
note

This is a hack to reuse code from HTMLPurifier_ChildDef_Required, really, one shouldn't inherit from the other. Only altered behavior is to overload a returned false with an array. Thus, it will never return false.

Table of Contents

Properties

$allow_empty  : mixed
Indicates whether or not an empty array of children is okay.
$elements  : mixed
Lookup table of allowed elements.
$type  : mixed
Type of child definition, usually right-most part of class name lowercase.
$whitespace  : mixed
Whether or not the last passed node was all whitespace.

Methods

__construct()  : mixed
getAllowedElements()  : array<string|int, mixed>
Get lookup of tag names that should not close this element automatically.
validateChildren()  : array<string|int, mixed>
Validates nodes according to definition and returns modification.

Properties

$allow_empty

Indicates whether or not an empty array of children is okay.

public mixed $allow_empty = \true
Tags
type

bool

$elements

Lookup table of allowed elements.

public mixed $elements = array()
Tags
type

array

$type

Type of child definition, usually right-most part of class name lowercase.

public mixed $type = 'optional'
Tags
type

string

$whitespace

Whether or not the last passed node was all whitespace.

protected mixed $whitespace = \false
Tags
type

bool

Methods

__construct()

public __construct(array<string|int, mixed>|string $elements) : mixed
Parameters
$elements : array<string|int, mixed>|string

List of allowed element names (lowercase).

getAllowedElements()

Get lookup of tag names that should not close this element automatically.

public getAllowedElements(HTMLPurifier_Config $config) : array<string|int, mixed>

All other elements will do so.

Parameters
$config : HTMLPurifier_Config

HTMLPurifier_Config object

Return values
array<string|int, mixed>

        
On this page

Search results