https://github.com/thecodingmachine/utils.common.validators
This package contains typical validators to be used in your application. A validator is a class that decides whether a string is valid or not. For instance, you could use an EmailValidator to validate that a string is a mail, etc...
https://github.com/thecodingmachine/utils.common.validators
Last synced: 9 months ago
JSON representation
This package contains typical validators to be used in your application. A validator is a class that decides whether a string is valid or not. For instance, you could use an EmailValidator to validate that a string is a mail, etc...
- Host: GitHub
- URL: https://github.com/thecodingmachine/utils.common.validators
- Owner: thecodingmachine
- Created: 2012-11-23T11:48:23.000Z (over 13 years ago)
- Default Branch: 3.1
- Last Pushed: 2014-06-04T16:32:51.000Z (about 12 years ago)
- Last Synced: 2025-08-28T17:59:50.703Z (10 months ago)
- Language: PHP
- Size: 230 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Mouf validators
===============
This package contains typical validators to be used in your application.
A validator is a class that decides whether a string is valid or not and implements the `ValidatorInterface`.
The `ValidatorInterface` is part of this package.
For instance, you could use an `EmailValidator` to validate that a string is a mail, etc...
List of embedded validators
---------------------------
- `RequiredValidator`: validates a value is not empty
- `NumericValidator`: validates a value is a number (optionnally an integer)
- `EmailValidator`: validates an email address
- `URLValidator`: validates a URL (starting with http://, https:// or ftp://)
- `MaxMinRangeValidator`: validates a value is between 2 bounds
- `MaxMinRangeLengthValidator`: validates a string length is between 2 bounds
- `SiretValidator`: validates a value is a valid SIRET number (French company id)
Javascript validation
---------------------
If the validator implements the `JsValidatorInterface`, it provides the code to be run both in PHP and in Javascript.
This means you can use this validator to generate Javascript code that validates any value.
I18n
----
The validators in the packet rely in [Fine](http://mouf-php.com/packages/mouf/utils.i18n.fine/README.md) for
translating validation error messages.