Skip to content

Installation

phil/phone-bundle
RequirementVersionWhy
PHP8.5 or laterThe floor the bundle declares
phil/phone^0.1@devThe value types and the numbering plans
symfony/form, symfony/options-resolver^8.2PhoneType
symfony/validator^8.2ValidPhoneNumber
symfony/dependency-injection, symfony/config^8.2The bundle class and its configuration
doctrine/dbaloptionalThe column type phil_phone
twig/twigoptionalThe filters
composer require phil/phone-bundle
// config/bundles.php
return [
    // ...
    Phil\PhoneBundle\PhilPhoneBundle::class => ['all' => true],
];

Configuration

phil_phone:
    # The country a number typed without its country code is read in, by its ISO 3166-1 alpha-2 code in
    # capitals; null, the default, asks for the country code.
    default_region: CA

The field, the constraint and the filters read it; each field and constraint may name its own.