<?php

defined('_JEXEC') or die;

use Joomla\CMS\Component\Router\RouterServiceInterface;
use Joomla\CMS\Component\Router\RouterFactoryInterface;
use Joomla\CMS\Router\Route;

return [
    'services' => [
        RouterServiceInterface::class => function (RouterFactoryInterface $routerFactory) {
            $router = $routerFactory->create('site');

            $router->addRoute(
                'com_leaflet',
                [
                    'pattern' => 'ajax',
                    'controller' => 'ajax',
                    'task' => 'myAjaxFunction',
                ]
            );
            return $router;
        },
    ],
];
