mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-12-01 12:33:45 +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)
|
||||
{
|
||||
$mapper = $event->getDefinitionMapper();
|
||||
$container = $GLOBALS['container']['leaflet.service-container'];
|
||||
|
||||
foreach ($GLOBALS['LEAFLET_MAPPERS'] as $className) {
|
||||
if (is_array($className)) {
|
||||
$mapper->register(new $className[0], $className[1]);
|
||||
} else {
|
||||
$mapper->register(new $className());
|
||||
$mapper->register(new $className($container));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user