Skip to content

Installation

phil/geo-bundle
RequirementVersionWhy
PHP8.5 or later, with ext-intl and ext-zlibThe floor the bundle declares; format_distance writes numbers in the locale; phil:geo:maxmind:update decompresses the archive
phil/geo^0.1@devThe value types
symfony/form, symfony/options-resolver^8.2CoordinatesType
symfony/dependency-injection, symfony/config^8.2The bundle class and its configuration tree
doctrine/ormoptionalCoordinates as an embeddable
twig/twigoptionalThe Twig functions and filter
@hotwired/stimulus^3.0, the application'sThe distance-sort controller
composer require phil/geo-bundle
// config/bundles.php
return [
    // ...
    Phil\GeoBundle\PhilGeoBundle::class => ['all' => true],
];

Configuring

# config/packages/phil_geo.yaml
phil_geo:
    doctrine_mapping: true   # maps Phil\Geo\Coordinates as an embeddable when the ORM is configured

The Stimulus controller

The controller ships in assets/, declared in assets/package.json as distance-sort. With Symfony UX and the AssetMapper or Webpack Encore, add the package to assets/controllers.json; it is then named phil--geo-bundle--distance-sort. See distance-sort.md.