Abstract Class HTMLPurifier_AttrTransform
Processes an entire attribute array for corrections needing multiple values.
Occasionally, a certain attribute will need to be removed and popped onto another value. Instead of creating a complex return syntax for HTMLPurifier_AttrDef, we just pass the whole attribute array to a specialized object and have that do the special work. That is the family of HTMLPurifier_AttrTransform.
An attribute transformation can be assigned to run before or after HTMLPurifier_AttrDef validation. See HTMLPurifier_HTMLDefinition for more details.
Public Methods
Method | Description | Defined By |
---|---|---|
confiscateAttr() | Retrieves and removes an attribute | HTMLPurifier_AttrTransform |
prependCSS() | Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist. | HTMLPurifier_AttrTransform |
transform() | Abstract: makes changes to the attributes dependent on multiple values. | HTMLPurifier_AttrTransform |
Method Details
Retrieves and removes an attribute
public mixed confiscateAttr ( <b>&</b>$attr, $key ) | ||
$attr | ||
$key | mixed | Key of attribute to confiscate |
Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist.
public void prependCSS ( <b>&</b>$attr, $css ) | ||
$attr | ||
$css | string | CSS to prepend |
Abstract: makes changes to the attributes dependent on multiple values.
public abstract array transform ( $attr, $config, $context ) | ||
$attr | array | Assoc array of attributes, usually from
|
$config | HTMLPurifier_Config | Mandatory HTMLPurifier_Config object. |
$context | HTMLPurifier_Context | Mandatory HTMLPurifier_Context object |
return | array | Processed attribute array. |
---|