HTMLPurifier 4.4.0
HTMLPurifier_ChildDef_Optional Class Reference

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

Inheritance diagram for HTMLPurifier_ChildDef_Optional:
HTMLPurifier_ChildDef_Required HTMLPurifier_ChildDef_Required HTMLPurifier_ChildDef HTMLPurifier_ChildDef HTMLPurifier_ChildDef HTMLPurifier_ChildDef

List of all members.

Public Member Functions

 validateChildren ($tokens_of_children, $config, $context)
 Validates nodes according to definition and returns modification.
 validateChildren ($tokens_of_children, $config, $context)
 Validates nodes according to definition and returns modification.

Public Attributes

 $allow_empty = true
 Bool that indicates whether or not an empty array of children is okay.
 $type = 'optional'
 Type of child definition, usually right-most part of class name lowercase.

Detailed Description

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

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.

Definition at line 10 of file Optional.php.


Member Function Documentation

HTMLPurifier_ChildDef_Optional::validateChildren ( tokens_of_children,
config,
context 
)

Validates nodes according to definition and returns modification.

Parameters:
$tokens_of_childrenArray of HTMLPurifier_Token
$configHTMLPurifier_Config object
$contextHTMLPurifier_Context object
Returns:
bool true to leave nodes as is
bool false to remove parent node
array of replacement child tokens

Reimplemented from HTMLPurifier_ChildDef_Required.

Definition at line 14 of file Optional.php.

References $config.

Referenced by validateChildren().

HTMLPurifier_ChildDef_Optional::validateChildren ( tokens_of_children,
config,
context 
)

Validates nodes according to definition and returns modification.

Parameters:
$tokens_of_childrenArray of HTMLPurifier_Token
$configHTMLPurifier_Config object
$contextHTMLPurifier_Context object
Returns:
bool true to leave nodes as is
bool false to remove parent node
array of replacement child tokens

Reimplemented from HTMLPurifier_ChildDef_Required.

Definition at line 11716 of file HTMLPurifier.standalone.php.

References $config, and validateChildren().


Member Data Documentation

HTMLPurifier_ChildDef_Optional::$allow_empty = true

Bool that indicates whether or not an empty array of children is okay.

This is necessary for redundant checking when changes affecting a child node may cause a parent node to now be disallowed.

Reimplemented from HTMLPurifier_ChildDef_Required.

Definition at line 12 of file Optional.php.

HTMLPurifier_ChildDef_Optional::$type = 'optional'

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

Used occasionally in terms of context.

Reimplemented from HTMLPurifier_ChildDef_Required.

Definition at line 13 of file Optional.php.


The documentation for this class was generated from the following files: