PHP Class Phalcon\Validation\Validator\Decimal

Validates that a value is a valid number in proper decimal format (negative and decimal numbers allowed). Optionally, a specific number of digits can be checked too. Uses {@link http://www.php.net/manual/en/function.localeconv.php locale conversion} to allow decimal point to be locale specific. use Phalcon\Validation\Validator\Decimal; $validator->add('number', new Decimal([ 'places' => 2, 'digit' => 3, // optional 'point' => ',' // optional. uses to override system decimal point 'message' => 'Price must contain valid decimal value', ]));
Inheritance: extends Phalcon\Validation\Validator
ファイルを表示 Open project: phalcon/incubator

Public Methods

Method Description
validate ( Phalcon\Validation $validation, string $attribute ) : boolean

Method Details

validate() public method

public validate ( Phalcon\Validation $validation, string $attribute ) : boolean
$validation Phalcon\Validation
$attribute string
return boolean