mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-12-01 04:24:02 +01:00
Pass service container to mapper factory.
This commit is contained in:
@@ -53,13 +53,14 @@ class BootSubscriber implements EventSubscriberInterface
|
||||
*/
|
||||
public function initializeDefinitionMapper(InitializeDefinitionMapperEvent $event)
|
||||
{
|
||||
$mapper = $event->getDefinitionMapper();
|
||||
$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