Source for file AttrTypes.php
Documentation is available at AttrTypes.php
* Provides lookup array of attribute types to HTMLPurifier_AttrDef objects
* Lookup array of attribute string identifiers to concrete implementations
protected $info =
array();
* Constructs the info array, supplying default implementations for attribute
// pseudo-types, must be instantiated via shorthand
// number is really a positive integer (one or more digits)
// FIXME: ^^ not always, see start and value of list items
* @param $type String type name
* @return Object AttrDef for type
public function get($type) {
// determine if there is any extra info tacked on
if (strpos($type, '#') !==
false) list
($type, $string) =
explode('#', $type, 2);
if (!isset
($this->info[$type])) {
trigger_error('Cannot retrieve undefined attribute type ' .
$type, E_USER_ERROR);
return $this->info[$type]->make($string);
* Sets a new implementation for a type
* @param $type String type name
* @param $impl Object AttrDef for type
public function set($type, $impl) {
$this->info[$type] =
$impl;
Documentation generated on Thu, 19 Jun 2008 18:48:50 -0400 by phpDocumentor 1.4.2