\HTMLPurifier_HTMLModuleManager

Summary

Methods
Properties
Constants
__construct()
registerModule()
addModule()
addPrefix()
setup()
processModule()
getElements()
getElement()
$doctypes
$doctype
$attrTypes
$modules
$registeredModules
$userModules
$elementLookup
$prefixes
$contentSets
$attrCollections
$trusted
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$doctypes

$doctypes

$doctype

$doctype

Instance of current doctype.

$attrTypes

$attrTypes

$modules

$modules

Active instances of modules for the specified doctype are indexed, by name, in this array.

$registeredModules

$registeredModules

Array of recognized HTMLPurifier_HTMLModule instances, indexed by module's class name. This array is usually lazy loaded, but a user can overload a module by pre-emptively registering it.

$userModules

$userModules

List of extra modules that were added by the user using addModule(). These get unconditionally merged into the current doctype, whatever it may be.

$elementLookup

$elementLookup

Associative array of element name to list of modules that have definitions for the element; this array is dynamically filled.

$prefixes

$prefixes

List of prefixes we should use for registering small names.

$contentSets

$contentSets

$attrCollections

$attrCollections

$trusted

$trusted

If set to true, unsafe elements and attributes will be allowed.

Methods

__construct()

__construct() : mixed

Returns

mixed —

registerModule()

registerModule( $module,  $overload = false) : mixed

Registers a module to the recognized module list, useful for overloading pre-existing modules.

Parameters

$module

Mixed: string module name, with or without HTMLPurifier_HTMLModule prefix, or instance of subclass of HTMLPurifier_HTMLModule.

$overload

Boolean whether or not to overload previous modules. If this is not set, and you do overload a module, HTML Purifier will complain with a warning.

Returns

mixed —

addModule()

addModule(mixed  $module) : mixed

Adds a module to the current doctype by first registering it, and then tacking it on to the active doctype

Parameters

mixed $module

Returns

mixed —

addPrefix()

addPrefix(mixed  $prefix) : mixed

Adds a class prefix that registerModule() will use to resolve a string name to a concrete class

Parameters

mixed $prefix

Returns

mixed —

setup()

setup(\HTMLPurifier_Config  $config) : mixed

Performs processing on modules, after being called you may use getElement() and getElements()

Parameters

\HTMLPurifier_Config $config

Returns

mixed —

processModule()

processModule(mixed  $module) : mixed

Takes a module and adds it to the active module collection, registering it if necessary.

Parameters

mixed $module

Returns

mixed —

getElements()

getElements() : array

Retrieves merged element definitions.

Returns

array —

of HTMLPurifier_ElementDef

getElement()

getElement(string  $name, bool  $trusted = null) : \HTMLPurifier_ElementDef

Retrieves a single merged element definition

Parameters

string $name

Name of element

bool $trusted

Boolean trusted overriding parameter: set to true if you want the full version of an element

Returns

\HTMLPurifier_ElementDef —

Merged HTMLPurifier_ElementDef