A Symfony2 Bundle to handle locations. This provided a Locaiton object with differnet parts to clearly identify a location.
php composer.phar require happyr/location-bundle
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Happyr\LocationBundle\HappyrLocationBundle(),
);
}
You need to specify a geocoder service to in the coniguration. The geoder must inplement the GeocoderInterface
happyr_location:
geocoder_service: 'acme.geocoder'
//any form
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('location', 'location', array(
'components'=>array(
'country'=>true,
'city'=>true,
)
));
}