Validation\Validator\Regex::validate

public validate (Phalcon\Validation $validation, mixed $field) Executes the validation

Validation\Validator\Regex

extends abstract class Phalcon\Validation\Validator implements Phalcon\Validation\ValidatorInterface Source on GitHub Allows validate if the value of a field matches a regular expression use Phalcon\Validation\Validator\Regex as RegexValidator; $validator->add('created_at', new RegexValidator([ 'pattern' => '/^[0-9]{4}[-\/](0[1-9]|1[12])[-\/](0[1-9]|[12][0-9]|3[01])$/', 'message' => 'The creation date is invalid' ])); $validator->add(['created_at', 'name'], new RegexV

Validation\Validator\PresenceOf::validate

public validate (Phalcon\Validation $validation, mixed $field) Executes the validation

Validation\Validator\PresenceOf

extends abstract class Phalcon\Validation\Validator implements Phalcon\Validation\ValidatorInterface Source on GitHub Validates that a value is not null or empty string use Phalcon\Validation\Validator\PresenceOf; $validator->add('name', new PresenceOf([ 'message' => 'The name is required' ])); $validator->add(['name', 'email'], new PresenceOf([ 'message' => [ 'name' => 'The name is required', 'email' => 'The email is required' ] ])); Me

Validation\Validator\Numericality::validate

public validate (Phalcon\Validation $validation, mixed $field) Executes the validation

Validation\Validator\Numericality

extends abstract class Phalcon\Validation\Validator implements Phalcon\Validation\ValidatorInterface Source on GitHub Check for a valid numeric value use Phalcon\Validation\Validator\Numericality; $validator->add('price', new Numericality([ 'message' => ':field is not numeric' ])); $validator->add(['price', 'amount'], new Numericality([ 'message' => [ 'price' => 'price is not numeric', 'amount' => 'amount is not numeric' ] ])); Methods p

Validation\Validator\InclusionIn::validate

public validate (Phalcon\Validation $validation, mixed $field) Executes the validation

Validation\Validator\InclusionIn

extends abstract class Phalcon\Validation\Validator implements Phalcon\Validation\ValidatorInterface Source on GitHub Check if a value is included into a list of values use Phalcon\Validation\Validator\InclusionIn; $validator->add('status', new InclusionIn([ 'message' => 'The status must be A or B', 'domain' => array('A', 'B') ])); $validator->add(['status', 'type'], new InclusionIn([ 'message' => [ 'status' => 'The status must be A or B',

Validation\Validator\Identical::validate

public validate (Phalcon\Validation $validation, mixed $field) Executes the validation

Validation\Validator\Identical

extends abstract class Phalcon\Validation\Validator implements Phalcon\Validation\ValidatorInterface Source on GitHub Checks if a value is identical to other use Phalcon\Validation\Validator\Identical; $validator->add('terms', new Identical([ 'accepted' => 'yes', 'message' => 'Terms and conditions must be accepted' ])); $validator->add(['terms', 'anotherTerms'], new Identical([ 'accepted' => [ 'terms' => 'yes', 'anotherTerms' => 'yes'