forked from Snck3rs/contao-leaflet-maps
Refactor frontend integration using dependency injection.
This commit is contained in:
@@ -14,6 +14,7 @@ use Netzmacht\Contao\Leaflet\Alias\DefaultAliasFilter;
|
||||
use Netzmacht\Contao\Leaflet\Boot;
|
||||
use Netzmacht\Contao\Leaflet\ContaoAssets;
|
||||
use Netzmacht\Contao\Leaflet\Dca\ControlCallbacks;
|
||||
use Netzmacht\Contao\Leaflet\Dca\FrontendIntegration;
|
||||
use Netzmacht\Contao\Leaflet\Dca\LayerCallbacks;
|
||||
use Netzmacht\Contao\Leaflet\Dca\MapCallbacks;
|
||||
use Netzmacht\Contao\Leaflet\DependencyInjection\LeafletServices;
|
||||
@@ -199,6 +200,19 @@ $container['leaflet.dca.control-callbacks'] = $container->share(
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* Callback helper class for frontend integration.
|
||||
*
|
||||
* @return FrontendIntegration
|
||||
*/
|
||||
$container['leaflet.dca.frontend-integration'] = $container->share(
|
||||
function ($container) {
|
||||
return new FrontendIntegration(
|
||||
$container[Services::TRANSLATOR]
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* Component factory for content element.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user