"wxr/geo-bundle": "dev-master"
$ composer update
new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(),
new WXR\CommonBundle\WXRCommonBundle(),
new WXR\GeoBundle\WXRGeoBundle(),
$ php app/console sonata:easy-extends:generate WXRGeoBundle --dest=src
new Application\WXR\GeoBundle\ApplicationWXRGeoBundle(),
# app/config/routing.yml
wxr_geo:
resource: "@WXRGeoBundle/Resources/config/routing.yml"
prefix: /geo
Useful for autocompletion.
Override SonataAdminBundle::standard_layout.html.twig
to import Google Map API.
<!-- Google Maps API -->
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY&sensor=false"></script>
Latitude and longitude will be automatically retrieved trough geocoding.js.
WXRGeoBundle doesn't require any configuration.
wxr_geo:
translation_domain: WXRGeoBundle
country:
manager: wxr_geo.country.manager.default
admin:
class: WXR\GeoBundle\Admin\Entity\CountryAdmin
controller: SonataAdminBundle:CRUD
region:
manager: wxr_geo.region.manager.default
admin:
class: WXR\GeoBundle\Admin\Entity\RegionAdmin
controller: SonataAdminBundle:CRUD
city:
manager: wxr_geo.city.manager.default
admin:
class: WXR\GeoBundle\Admin\Entity\CityAdmin
controller: SonataAdminBundle:CRUD
address:
manager: wxr_geo.address.manager.default
admin:
class: WXR\GeoBundle\Admin\Entity\AddressAdmin
controller: SonataAdminBundle:CRUD