PHP Class HTMLPurifier_Length, yii

Afficher le fichier Open project: yiisoft/yii Class Usage Examples

Protected Properties

Свойство 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.

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
validate ( ) : boolean Validates the number and unit.

Method Details

__construct() public méthode

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

compareTo() public méthode

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

getN() public méthode

Retrieves string numeric magnitude.
public getN ( ) : string
Résultat string

getUnit() public méthode

Retrieves string unit.
public getUnit ( ) : string
Résultat string

isValid() public méthode

Returns true if this length unit is valid.
public isValid ( ) : boolean
Résultat boolean

make() public static méthode

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

toString() public méthode

Returns string representation of number.
public toString ( ) : string
Résultat string

validate() protected méthode

Validates the number and unit.
protected validate ( ) : boolean
Résultat 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