PHPackages                             daften/addressing-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. daften/addressing-bundle

ActiveLibrary[Localization &amp; i18n](/categories/localization)

daften/addressing-bundle
========================

Provides an integration between commerceguys addressing package and Symfony.

2.0.1(2y ago)43.3k6[2 issues](https://github.com/daften/addressing-bundle/issues)MITPHPPHP ^7.4 | ^8.0

Since Jul 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/daften/addressing-bundle)[ Packagist](https://packagist.org/packages/daften/addressing-bundle)[ RSS](/packages/daften-addressing-bundle/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (9)Used By (0)

The Addressing Bundle
=====================

[](#the-addressing-bundle)

[![Build Status](https://camo.githubusercontent.com/bcafe892d78e49776c71d69a1d3f2fb0a8e508a3a6fe5f65739fd2e5a7fd3547/68747470733a2f2f7472617669732d63692e6f72672f64616674656e2f61646472657373696e672d62756e646c652e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/daften/addressing-bundle)[![Maintainability](https://camo.githubusercontent.com/3925504ece3d82742d579d44f99649da597d0a6b1c4a2c3ee661761c31dd801c/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f63386430343131633661653531633166313131392f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/daften/addressing-bundle/maintainability)

Requirements
------------

[](#requirements)

- jQuery loaded as $
- jQuery Once loaded properly.

Installation
------------

[](#installation)

Add the mapping to your doctrine.yaml file:

```
doctrine:
    ...
    orm:
        ...
        entity_managers:
            default:
                ...
                mappings:
                    AddressingBundle:
                        is_bundle: true
```

TODO: Explain why this mapping is needed.

You'll also need to add some configuration or javascript depending on the form you'll use for address information. For this you need to run `bin/console assets:install` to copy the bundle assets to the public folder.

### AddressEmbeddableType

[](#addressembeddabletype)

You'll also need to add some javascript code, to make sure the form changes on changing the country code work.

The script below gives an example. You just need to initialize the javascript functionality. All address fields will automatically be covered. This only works when using Symfony 4 with Webpack Encore.

```
var countryCodeChange = require('../../public/bundles/addressing/js/countryCodeChange');
countryCodeChange.initialize();
```

### AddressEmbeddableGmapsAutocompleteType

[](#addressembeddablegmapsautocompletetype)

You'll also need to add some javascript code, to make sure the autocomplete functionality works.

The script below gives an example. You just need to initialize the javascript functionality. All autocomplete address fields will automatically be covered. This only works when using Symfony 4 with Webpack Encore.

```
var addressGmapsAutocomplete = require('../../public/bundles/addressing/js/addressGmapsAutocomplete');
addressGmapsAutocomplete.initialize();
```

You also need to add the Google API key to the .env file with property key GMAPS\_API\_KEY. You can override this by overruling the service definition for daften.service.gmaps\_autocomplete\_service.

Usage
-----

[](#usage)

### Entity property

[](#entity-property)

You need to add an address field as an ORM Embedded property.

```
