PHP Class HTMLPurifier_Length, yii

Mostrar archivo Open project: yiisoft/yii Class Usage Examples

Protected Properties

Property Type Description
$allowedUnits Array Lookup array of units recognized by CSS 2.1
$isValid Whether or not this length is valid. Null if not calculated yet.
$n String numeric magnitude.
$unit String unit. False is permitted if $n = 0.

Public Methods

Method Description
__construct ( string $n = '0', boolean | string $u = false )
compareTo ( HTMLPurifier_Length $l ) : integer Compares two lengths, and returns 1 if greater, -1 if less and 0 if equal.
getN ( ) : string Retrieves string numeric magnitude.
getUnit ( ) : string Retrieves string unit.
isValid ( ) : boolean Returns true if this length unit is valid.
make ( string $s ) : HTMLPurifier_Length
toString ( ) : string Returns string representation of number.

Protected Methods

Method Description
validate ( ) : boolean Validates the number and unit.

Method Details

__construct() public method

public __construct ( string $n = '0', boolean | string $u = false )
$n string Magnitude
$u boolean | string Unit

compareTo() public method

Compares two lengths, and returns 1 if greater, -1 if less and 0 if equal.
public compareTo ( HTMLPurifier_Length $l ) : integer
$l HTMLPurifier_Length
return integer

getN() public method

Retrieves string numeric magnitude.
public getN ( ) : string
return string

getUnit() public method

Retrieves string unit.
public getUnit ( ) : string
return string

isValid() public method

Returns true if this length unit is valid.
public isValid ( ) : boolean
return boolean

make() public static method

public static make ( string $s ) : HTMLPurifier_Length
$s string Unit string, like '2em' or '3.4in'
return HTMLPurifier_Length

toString() public method

Returns string representation of number.
public toString ( ) : string
return string

validate() protected method

Validates the number and unit.
protected validate ( ) : boolean
return boolean

Property Details

$allowedUnits protected_oe static_oe property

Array Lookup array of units recognized by CSS 2.1
protected static $allowedUnits

$isValid protected_oe property

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

$n protected_oe property

String numeric magnitude.
protected $n

$unit protected_oe property

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