Validation\Validator\StringLength::validate

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

Validation\Validator\Uniqueness

extends abstract class Phalcon\Validation\CombinedFieldsValidator implements Phalcon\Validation\ValidatorInterface Source on GitHub Check that a field is unique in the related table use Phalcon\Validation\Validator\Uniqueness as UniquenessValidator; $validator->add('username', new UniquenessValidator([ 'model' => new Users(), 'message' => ':field must be unique' ])); Different attribute from the field: $validator->add('username', new UniquenessValidator([

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

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\InclusionIn::validate

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

Validation\Validator\Numericality::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\PresenceOf::validate

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

Validation\Validator\File

extends abstract class Phalcon\Validation\Validator implements Phalcon\Validation\ValidatorInterface Source on GitHub Checks if a value has a correct file use Phalcon\Validation\Validator\File as FileValidator; $validator->add('file', new FileValidator([ 'maxSize' => '2M', 'messageSize' => ':field exceeds the max filesize (:max)', 'allowedTypes' => array('image/jpeg', 'image/png'), 'messageType' => 'Allowed file types are :types', 'maxResolution' =>

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'