makinacorpus/iban-bundle

International Bank Account Number form type

Installs: 5 805

Dependents: 0

Suggesters: 0

Stars: 3

Watchers: 12

Forks: 0

Open Issues: 0

Type:symfony-bundle

1.0.5 2019-06-27 11:42 UTC

README

Simply gives you a nice widget for IBAN numbers, please note that it's based on the default bootstrap form theme (any of the normal or horizontal one).

Installation

Install the package:

composer require makinacorpus/iban-bundle

Register the associated form theme in your app/config.yml file:

twig:
    debug:            "%kernel.debug%"
    strict_variables: false
    form_themes:
        # ...
        - "IbanBundle:Form:fields.html.twig"

Usage

The widget has no options. Just add it to your form:

    $this->createFormBuilder()
        ->add('iban', IbanType::class, [
            'label'       => "IBAN",
            'required'    => true,
            'constraints' => [
                new Assert\Iban(),
            ],
        ])

Please use the Symfony\Component\Validator\Constraints\Iban class for validation, it does respect the ISO 7064 standard.