devilcius/extra-validator-bundle

Extra validators for spanish CCC, DNI...


Keywords
Symfony2, bundle, validators
License
MIT

Documentation

devilciusExtraValidatorBundle

Build Status

This bundle provides validators for common spanish input forms.

Current validators:

CCC

C├│digo Cuenta Cliente

NIF

N┬║ de indetificaci├│n fiscal

Installation

composer

{
    "require": {
        "devilcius/extra-validator-bundle": "dev-master"
    }
}

validation.xml

<?xml version="1.0" ?>
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping
        http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">

    <class name="Acme\DemoBundle\Entity\User">
        <property name="ccc">
            <constraint name="devilcius\ExtraValidatorBundle\Validator\Constraints\Ccc" >
                <option name="message">Nº de cuenta no válido</option>             
            </constraint>
        </property>
        <property name="dni">
            <constraint name="devilcius\ExtraValidatorBundle\Validator\Constraints\Dni" >
                <option name="message">Nº de DNI no válido</option>          
            </constraint>
        </property>
    </class>
</constraint-mapping>