|
| __construct ($n='0', $u=false) |
|
| compareTo ($l) |
| Compares two lengths, and returns 1 if greater, -1 if less and 0 if equal.
|
|
| getN () |
| Retrieves string numeric magnitude.
|
|
| getUnit () |
| Retrieves string unit.
|
|
| isValid () |
| Returns true if this length unit is valid.
|
|
| toString () |
| Returns string representation of number.
|
|
|
| validate () |
| Validates the number and unit.
|
|
|
| $isValid |
| Whether or not this length is valid.
|
|
| $n |
| String numeric magnitude.
|
|
| $unit |
| String unit.
|
|
|
static | $allowedUnits |
| Array Lookup array of units recognized by CSS 3 @type array.
|
|
◆ __construct()
HTMLPurifier_Length::__construct |
( |
| $n = '0', |
|
|
| $u = false ) |
- Parameters
-
string | $n | Magnitude |
bool | string | $u | Unit |
◆ compareTo()
HTMLPurifier_Length::compareTo |
( |
| $l | ) |
|
Compares two lengths, and returns 1 if greater, -1 if less and 0 if equal.
- Parameters
-
- Return values
-
- Warning
- If both values are too large or small, this calculation will not work properly
◆ getN()
HTMLPurifier_Length::getN |
( |
| ) |
|
Retrieves string numeric magnitude.
- Return values
-
◆ getUnit()
HTMLPurifier_Length::getUnit |
( |
| ) |
|
Retrieves string unit.
- Return values
-
◆ isValid()
HTMLPurifier_Length::isValid |
( |
| ) |
|
Returns true if this length unit is valid.
- Return values
-
◆ make()
static HTMLPurifier_Length::make |
( |
| $s | ) |
|
|
static |
- Parameters
-
string | $s | Unit string, like '2em' or '3.4in' |
- Return values
-
- Warning
- Does not perform validation.
◆ toString()
HTMLPurifier_Length::toString |
( |
| ) |
|
Returns string representation of number.
- Return values
-
◆ validate()
HTMLPurifier_Length::validate |
( |
| ) |
|
|
protected |
Validates the number and unit.
- Return values
-
◆ $allowedUnits
HTMLPurifier_Length::$allowedUnits |
|
staticprotected |
Initial value:= array(
'em' => true, 'ex' => true, 'px' => true, 'in' => true,
'cm' => true, 'mm' => true, 'pt' => true, 'pc' => true,
'ch' => true, 'rem' => true, 'vw' => true, 'vh' => true,
'vmin' => true, 'vmax' => true
)
Array Lookup array of units recognized by CSS 3 @type array.
◆ $isValid
HTMLPurifier_Length::$isValid |
|
protected |
Whether or not this length is valid.
Null if not calculated yet. @type bool
◆ $n
String numeric magnitude.
@type string
◆ $unit
HTMLPurifier_Length::$unit |
|
protected |
String unit.
False is permitted if $n = 0. @type string|bool
The documentation for this class was generated from the following file:
- lib/htmlpurifier/HTMLPurifier/Length.php