Decorator that, depending on a token, switches between two definitions.
More...
Decorator that, depending on a token, switches between two definitions.
Definition at line 6 of file Switch.php.
◆ __construct()
HTMLPurifier_AttrDef_Switch::__construct |
( |
|
$tag, |
|
|
|
$with_tag, |
|
|
|
$without_tag |
|
) |
| |
- Parameters
-
Definition at line 17 of file Switch.php.
References $tag.
19 $this->withTag = $with_tag;
20 $this->withoutTag = $without_tag;
◆ validate()
HTMLPurifier_AttrDef_Switch::validate |
( |
|
$string, |
|
|
|
$config, |
|
|
|
$context |
|
) |
| |
Definition at line 23 of file Switch.php.
24 $token = $context->get(
'CurrentToken',
true);
25 if (!$token || $token->name !== $this->tag) {
26 return $this->withoutTag->validate($string, $config, $context);
28 return $this->withTag->validate($string, $config, $context);
◆ $tag
HTMLPurifier_AttrDef_Switch::$tag |
|
protected |
◆ $withoutTag
HTMLPurifier_AttrDef_Switch::$withoutTag |
◆ $withTag
HTMLPurifier_AttrDef_Switch::$withTag |
|
protected |
The documentation for this class was generated from the following file:
- Services/Html/HtmlPurifier/library/HTMLPurifier/AttrDef/Switch.php