\HTMLPurifier_AttrDef_Switch

Decorator that, depending on a token, switches between two definitions.

Summary

Methods
Properties
Constants
__construct()
validate()
No public properties found
No constants found
No protected methods found
$tag
$withTag
$withoutTag
N/A
No private methods found
No private properties found
N/A

Properties

$tag

$tag

$withTag

$withTag

$withoutTag

$withoutTag

Methods

__construct()

__construct(string  $tag, \HTMLPurifier_AttrDef  $with_tag, \HTMLPurifier_AttrDef  $without_tag) : mixed

Parameters

string $tag

Tag name to switch upon

\HTMLPurifier_AttrDef $with_tag

Call if token matches tag

\HTMLPurifier_AttrDef $without_tag

Call if token doesn't match, or there is no token

Returns

mixed —

validate()

validate(string  $string, \HTMLPurifier_Config  $config, \HTMLPurifier_Context  $context) : bool|string

Parameters

string $string
\HTMLPurifier_Config $config
\HTMLPurifier_Context $context

Returns

bool|string —