HTMLPurifier_AttrTransform_EnumToCSS
extends HTMLPurifier_AttrTransform
in package
Generic pre-transform that converts an attribute with a fixed number of values (enumerated) to CSS.
Table of Contents
Properties
- $attr : mixed
- Name of attribute to transform from.
- $caseSensitive : mixed
- Case sensitivity of the matching.
- $enumToCSS : mixed
- Lookup array of attribute values to CSS.
Methods
- __construct() : mixed
- confiscateAttr() : mixed
- Retrieves and removes an attribute
- prependCSS() : mixed
- Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist.
- transform() : array<string|int, mixed>
- Abstract: makes changes to the attributes dependent on multiple values.
Properties
$attr
Name of attribute to transform from.
protected
mixed
$attr
Tags
$caseSensitive
Case sensitivity of the matching.
protected
mixed
$caseSensitive
= \false
Tags
$enumToCSS
Lookup array of attribute values to CSS.
protected
mixed
$enumToCSS
= array()
Tags
Methods
__construct()
public
__construct(string $attr, array<string|int, mixed> $enum_to_css[, bool $case_sensitive = false ]) : mixed
Parameters
- $attr : string
-
Attribute name to transform from
- $enum_to_css : array<string|int, mixed>
-
Lookup array of attribute values to CSS
- $case_sensitive : bool = false
-
Case sensitivity indicator, default false
confiscateAttr()
Retrieves and removes an attribute
public
confiscateAttr(array<string|int, mixed> &$attr, mixed $key) : mixed
Parameters
- $attr : array<string|int, mixed>
-
Attribute array to process (passed by reference)
- $key : mixed
-
Key of attribute to confiscate
prependCSS()
Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist.
public
prependCSS(array<string|int, mixed> &$attr, string $css) : mixed
Parameters
- $attr : array<string|int, mixed>
-
Attribute array to process (passed by reference)
- $css : string
-
CSS to prepend
transform()
Abstract: makes changes to the attributes dependent on multiple values.
public
transform(array<string|int, mixed> $attr, HTMLPurifier_Config $config, HTMLPurifier_Context $context) : array<string|int, mixed>
Parameters
- $attr : array<string|int, mixed>
- $config : HTMLPurifier_Config
- $context : HTMLPurifier_Context