Decorator that, depending on a token, switches between two definitions.
More...
Public Member Functions |
| __construct ($tag, $with_tag, $without_tag) |
| validate ($string, $config, $context) |
Detailed Description
Decorator that, depending on a token, switches between two definitions.
Definition at line 6 of file Switch.php.
Constructor & Destructor Documentation
HTMLPurifier_AttrDef_Switch::__construct |
( |
|
$tag, |
|
|
|
$with_tag, |
|
|
|
$without_tag |
|
) |
| |
- Parameters
-
Definition at line 17 of file Switch.php.
References $tag.
{
$this->withTag = $with_tag;
$this->withoutTag = $without_tag;
}
Member Function Documentation
HTMLPurifier_AttrDef_Switch::validate |
( |
|
$string, |
|
|
|
$config, |
|
|
|
$context |
|
) |
| |
Definition at line 23 of file Switch.php.
{
$token = $context->get('CurrentToken', true);
if (!$token || $token->name !== $this->tag) {
return $this->withoutTag->validate($string, $config, $context);
} else {
return $this->withTag->validate($string, $config, $context);
}
}
Field Documentation
HTMLPurifier_AttrDef_Switch::$tag |
|
protected |
HTMLPurifier_AttrDef_Switch::$withoutTag |
HTMLPurifier_AttrDef_Switch::$withTag |
|
protected |
The documentation for this class was generated from the following file:
- Services/Html/HtmlPurifier/library/HTMLPurifier/AttrDef/Switch.php