HTMLPurifier_AttrDef_Switch
in package
Decorator that, depending on a token, switches between two definitions.
Table of Contents
Properties
- $tag : mixed
- $withoutTag : mixed
- $withTag : mixed
Methods
- __construct() : mixed
- validate() : bool|string
Properties
$tag
protected
mixed
$tag
Tags
$withoutTag
protected
mixed
$withoutTag
Tags
$withTag
protected
mixed
$withTag
Tags
Methods
__construct()
public
__construct(string $tag, HTMLPurifier_AttrDef $with_tag, HTMLPurifier_AttrDef $without_tag) : mixed
Parameters
- $tag : string
-
Tag name to switch upon
- $with_tag : HTMLPurifier_AttrDef
-
Call if token matches tag
- $without_tag : HTMLPurifier_AttrDef
-
Call if token doesn't match, or there is no token
validate()
public
validate(string $string, HTMLPurifier_Config $config, HTMLPurifier_Context $context) : bool|string
Parameters
- $string : string
- $config : HTMLPurifier_Config
- $context : HTMLPurifier_Context