Documentation

內容目录

上一个主题

< Class Phalcon\Validation\Validator\InclusionIn

下一个主题

Class Phalcon\Validation\Validator\PresenceOf >

本页

Class Phalcon\Validation\Validator\Numericality

extends abstract class Phalcon\Validation\Validator

implements Phalcon\Validation\ValidatorInterface

Source on GitHub

Check for a valid numeric value

<?php

use Phalcon\Validation\Validator\Numericality;

$validator->add('price', new Numericality(array(
   'message' => ':field is not numeric'
)));

Methods

public validate (Phalcon\Validation $validation, unknown $field)

Executes the validation

public __construct ([unknown $options]) inherited from Phalcon\Validation\Validator

Phalcon\Validation\Validator constructor

public isSetOption (unknown $key) inherited from Phalcon\Validation\Validator

Checks if an option is defined

public hasOption (unknown $key) inherited from Phalcon\Validation\Validator

Checks if an option is defined

public getOption (unknown $key, [unknown $defaultValue]) inherited from Phalcon\Validation\Validator

Returns an option in the validator’s options Returns null if the option hasn’t set

public setOption (unknown $key, unknown $value) inherited from Phalcon\Validation\Validator

Sets an option in the validator

Follow along: