Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chaplean/location-bundle


https://github.com/chaplean/location-bundle

Last synced: 20 days ago
JSON representation

Awesome Lists containing this project

README

        

Getting Started With ChapleanLocationBundle
===========================================

# Prerequisites

This version of the bundle requires Symfony 2.8+.

# Installation

## 1. Composer

```
composer require chaplean/location-bundle
```

## 2. AppKernel.php

Add
```
new Chaplean\Bundle\LocationBundle\ChapleanLocationBundle(),
```

## 3. Inject locations

Run
```bash
bin/console location:load:cities
```
or
Add command in migration
```php
public function postUp(Schema $schema)
{
/** @var Kernel $kernel */
$kernel = $this->container->get('kernel');
$application = new Application($kernel);
$application->setAutoExit(false);

$exitCode = $application->run(
new ArrayInput(
[
'command' => 'location:load:cities'
]
)
);

$this->abortIf($exitCode !== 0, 'see Exception above ^');
}
```

## 4. Resources

* Regions: ?
* Départements: https://www.insee.fr/fr/information/2114819 (cf "Liste des départements")
* Villes: https://www.data.gouv.fr/fr/datasets/base-officielle-des-codes-postaux/