Register hook as tagged service.

This commit is contained in:
David Molineus
2017-11-15 11:13:24 +01:00
parent 27cef9b45b
commit 16e58f7f40
2 changed files with 4 additions and 12 deletions

View File

@@ -98,6 +98,7 @@ services:
netzmacht.contao_leaflet.listeners.register_libraries:
class: Netzmacht\Contao\Leaflet\Listener\RegisterLibrariesListener
arguments:
- '@netzmacht.contao_leaflet.libraries'
- '@netzmacht.contao_leaflet.definition.builder'
- '@netzmacht.contao_leaflet.libraries'
- '@netzmacht.contao_leaflet.definition.builder'
tags:
- { name: 'contao.hook', hook: 'initializeSystem', method: 'onInitializeSystem' }

View File

@@ -65,12 +65,3 @@ $GLOBALS['TL_MODELS']['tl_leaflet_marker'] = \Netzmacht\Contao\Leaflet\Model\Ma
$GLOBALS['TL_MODELS']['tl_leaflet_popup'] = \Netzmacht\Contao\Leaflet\Model\PopupModel::class;
$GLOBALS['TL_MODELS']['tl_leaflet_style'] = \Netzmacht\Contao\Leaflet\Model\StyleModel::class;
$GLOBALS['TL_MODELS']['tl_leaflet_vector'] = \Netzmacht\Contao\Leaflet\Model\VectorModel::class;
/*
* Hooks.
*/
$GLOBALS['TL_HOOKS']['initializeSystem'][] = [
'netzmacht.contao_leaflet.listeners.register_libraries',
'onInitializeSystem',
];