Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chaplean/location-bundle
https://github.com/chaplean/location-bundle
Last synced: 20 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/chaplean/location-bundle
- Owner: chaplean
- Created: 2019-07-09T20:01:17.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-07-09T20:12:11.000Z (over 5 years ago)
- Last Synced: 2024-04-28T16:20:52.283Z (9 months ago)
- Language: PHP
- Size: 3.71 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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/