makinacorpus/iban-bundle

国际银行账户号码表单类型

安装数: 12,342

依赖项: 0

建议者: 0

安全性: 0

星标: 4

关注者: 14

分支: 0

公开问题: 0

类型:symfony-bundle

1.0.5 2019-06-27 11:42 UTC

This package is auto-updated.

Last update: 2024-08-27 22:31:22 UTC


README

为IBAN号码提供了一个漂亮的组件,请注意,它基于默认的bootstrap表单主题(任何正常的或水平的主题)。

安装

安装包

composer require makinacorpus/iban-bundle

在您的app/config.yml文件中注册关联的表单主题

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

使用方法

组件没有选项。只需将其添加到您的表单中

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

请使用Symfony\Component\Validator\Constraints\Iban类进行验证,它符合ISO 7064标准。