happyr/location-bundle

A Symfony2 Bundle to handle geographic location of your entities

Installs: 316

Dependents: 0

Stars: 1

Watchers: 3

Language: PHP

0.3.0 2014-12-04 12:42 UTC

README

A Symfony2 Bundle to handle location in Sweden, Norway and Denmark.

Installation

  1. Install with composer:

    php composer.phar require happyr/location-bundle
    
  2. Enable the bundle:

// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Happyr\LocationBundle\HappyrLocationBundle(),
    );
}

Usage

//any form 
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('location', 'location', array(
                    'components'=>array(
                        'country'=>true,
                        'city'=>true,
                    )
                ));
    }

If you want to have the address name in the same language as the country the address is located you should use the ExcessiveGeocoder. Ie, Russian addresses will be in Russian and not in English.

happyr_location:
  enable_excessive_geocoder: true