[ RouterServiceInterface::class => function (RouterFactoryInterface $routerFactory) { $router = $routerFactory->create('site'); $router->addRoute( 'com_leaflet', [ 'pattern' => 'ajax', 'controller' => 'ajax', 'task' => 'myAjaxFunction', ] ); return $router; }, ], ];