Class HTMLPurifier_Length

Description

Represents a measurable length, with a string numeric magnitude and a unit.

Represents a measurable length, with a string numeric magnitude and a unit. This object is immutable.

Located in /library/HTMLPurifier/Length.php (line 7)


	
			
Variable Summary
static mixed $allowedUnits
mixed $isValid
mixed $n
mixed $unit
Method Summary
static void make (string $s)
HTMLPurifier_Length __construct ([number $n = '0'], [string $u = false])
void compareTo ( $l)
void getN ()
void getUnit ()
void isValid ()
void toString ()
void validate ()
Variables
static mixed $allowedUnits = array(
'em' => true, 'ex' => true, 'px' => true, 'in' => true,
'cm' => true, 'mm' => true, 'pt' => true, 'pc' => true
)
(line 28)

Lookup array of units recognized by CSS 2.

Lookup array of units recognized by CSS 2.1

  • access: protected
mixed $isValid (line 23)

Whether or not this length is valid.

Whether or not this length is valid. Null if not calculated yet.

  • access: protected
mixed $n (line 13)

String numeric magnitude.

String numeric magnitude.

  • access: protected
mixed $unit (line 18)

String unit.

String unit. False is permitted if $n = 0.

  • access: protected
Methods
static method make (line 46)
  • access: public
static void make (string $s)
  • string $s: Unit string, like '2em' or '3.4in'
Constructor __construct (line 37)
  • access: public
HTMLPurifier_Length __construct ([number $n = '0'], [string $u = false])
  • number $n: Magnitude
  • string $u: Unit
compareTo (line 103)

Compares two lengths, and returns 1 if greater, -1 if less and 0 if equal.

Compares two lengths, and returns 1 if greater, -1 if less and 0 if equal.

  • access: public
void compareTo ( $l)
  • $l
getN (line 83)

Retrieves string numeric magnitude.

Retrieves string numeric magnitude.

  • access: public
void getN ()
getUnit (line 88)

Retrieves string unit.

Retrieves string unit.

  • access: public
void getUnit ()
isValid (line 93)

Returns true if this length unit is valid.

Returns true if this length unit is valid.

  • access: public
void isValid ()
toString (line 75)

Returns string representation of number.

Returns string representation of number.

  • access: public
void toString ()
validate (line 58)

Validates the number and unit.

Validates the number and unit.

  • access: protected
void validate ()

Documentation generated on Thu, 19 Jun 2008 18:49:42 -0400 by phpDocumentor 1.4.2