There is no license information available for the latest version (1.1.0) of this package.

Easy way to route rest-like URLs to your code

Installs: 1 082

Dependents: 0

Suggesters: 0

Security: 0

Stars: 9

Watchers: 4

Forks: 2

Open Issues: 1


1.1.0 2020-12-15 19:44 UTC

This package is auto-updated.

Last update: 2021-04-09 04:56:15 UTC


Route any URL to your application.

You use this package if you want to route certain URLs directly to your controllers, completely ignoring the TYPO3 page routing.
This is especially useful to create REST APIs.


composer req sinso/app-routes


This package will look for Configuration/AppRoutes.yaml files in any loaded extension. Creating this file is all you need to get started:

  prefix: /myApi/v2
    - name: orders
      path: /orders
        handler: MyVendor\MyExtension\Api\OrdersEndpoint
    - name: order
      path: /order/{orderUid}
        handler: MyVendor\MyExtension\Api\OrderEndpoint

The class you provide as defaults.handler has to implement \Psr\Http\Server\RequestHandlerInterface. The routing parameters will be available in $request->getQueryParams().


Under the hood symfony/routing is used.

Everything that is available as YAML configuration option in symfony/routing should work with this package out of the box.

This package offers one additional option:

defaults.requiresTsfe: true - If true, then $GLOBALS['TSFE'] will be initialized before your handler is called.

Generate Route URLs

To generate URLs you can use the Sinso\AppRoutes\Service\Router:

$router = GeneralUtility::makeInstance(\Sinso\AppRoutes\Service\Router::class);
$url = $router->getUrlGenerator()->generate('myApp.order', ['orderUid' => 42]);

If you need to generate a URL in a Fluid template, there's also a ViewHelper for that:


{ar:route(routeName: 'myApp.order', parameters: {orderUid: '42'})}


Configuration Module

In the configuration module there's an entry "App Routes", that shows all configured routes. Requires TYPO3 v11