Skip to content

Installation

phil/address-bundle
RequirementVersionWhy
PHP8.5 or laterThe floor the bundle declares
ext-intlanyThe request's language, Locale
phil/address^0.1@devThe addresses, formats and subdivisions
symfony/form, symfony/options-resolver, symfony/intl^8.2The form and its country field
symfony/validator^8.2ValidAddress
symfony/http-foundation^8.2The format endpoint
symfony/translation-contracts^3.6Labels and messages translated, when a translator is there
symfony/dependency-injection, symfony/config^8.2The bundle class and its configuration
doctrine/dbal, symfony/routing, twig/twigoptionalThe column type, the endpoint's route, the filters
composer require phil/address-bundle
// config/bundles.php
return [
    // ...
    Phil\AddressBundle\PhilAddressBundle::class => ['all' => true],
];

Configuration

phil_address:
    default_country: CA                         # the country of a new address; null asks for it
    format_url: /address-format/__COUNTRY__     # the endpoint the Stimulus controller reads; null leaves it out
# config/routes/phil_address.yaml
phil_address:
    resource: '@PhilAddressBundle/config/routes.php'
    prefix: /address-format

With Symfony UX, the Stimulus controller is in assets/, declared in its package.json.