mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-12-02 04:53:56 +01:00
Pass service container to mapper factory.
This commit is contained in:
@@ -54,12 +54,13 @@ class BootSubscriber implements EventSubscriberInterface
|
|||||||
public function initializeDefinitionMapper(InitializeDefinitionMapperEvent $event)
|
public function initializeDefinitionMapper(InitializeDefinitionMapperEvent $event)
|
||||||
{
|
{
|
||||||
$mapper = $event->getDefinitionMapper();
|
$mapper = $event->getDefinitionMapper();
|
||||||
|
$container = $GLOBALS['container']['leaflet.service-container'];
|
||||||
|
|
||||||
foreach ($GLOBALS['LEAFLET_MAPPERS'] as $className) {
|
foreach ($GLOBALS['LEAFLET_MAPPERS'] as $className) {
|
||||||
if (is_array($className)) {
|
if (is_array($className)) {
|
||||||
$mapper->register(new $className[0], $className[1]);
|
$mapper->register(new $className[0], $className[1]);
|
||||||
} else {
|
} else {
|
||||||
$mapper->register(new $className());
|
$mapper->register(new $className($container));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user