markwilson / symfony2-validator-native-filter
Native PHP filter constraint for Symfony2 validator component
Installs: 1 659
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- symfony/validator: 2.2.x
This package is not auto-updated.
Last update: 2021-01-23 09:25:00 UTC
README
Note: currently only works for validator component 2.2.x
Native PHP filter constraint for Symfony2 validator component.
Install
Add markwilson/symfony2-validator-native-filter
to composer.json requires.
Usage
NativeFilter
requires a filter
option which must be one of the FILTER_
prefixed constants.
e.g.
use MarkWilson\Validator\Constraints\NativeFilter; use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Validation; $constraint = new NativeFilter( array( 'filter' => FILTER_VALIDATE_FLOAT ) ); $validator = Validation::createValidator(); $validator->validateValue($value, $constraint);