---
title: "Routing"
manual: "TYPO3 Explained"
version: "12.4"
permalink: "https://docs.typo3.org/permalink/t3coreapi:typo3-request-attribute-routing@12.4"
source: "ApiOverview/RequestLifeCycle/RequestAttributes/Routing.rst"
rendered: "2026-10-21T15:29:37+00:00"
---

> [!WARNING]
> **Attention**
>
> TYPO3 v12 has reached end-of-life as of April 30th 2026 and
> is no longer being maintained. Use the version switcher on the top
> left of this page to select documentation for a supported version of TYPO3.
>
> Need more time before upgrading?
> You can purchase Extended Long Term Support (ELTS) for TYPO3 v12 here:
> [TYPO3 ELTS](https://typo3.com/services/extended-support-elts).

# Routing {#typo3-request-attribute-routing}

-   [Frontend](https://docs.typo3.org/permalink/t3coreapi:frontend@12.4)
-   [Backend](https://docs.typo3.org/permalink/t3coreapi:backend@12.4)

## Frontend {#frontend}

The `routing` frontend request attribute provides routing information in
the object `\TYPO3\CMS\Core\Routing\PageArguments`. If you want to know the
current page ID or retrieve the query parameters this attribute is your friend.

Example:

```php
/** @var \Psr\Http\Message\ServerRequestInterface $request */
$pageArguments = $request->getAttribute('routing');
$pageId = $pageArguments->getPageId();
```

### API {#api}

-   **class PageArguments**

    -   *Fully qualified name:* `\TYPO3\CMS\Core\Routing\PageArguments`

    Contains all resolved parameters when a page is resolved from a page path segment plus all fragments.

    -   **areDirty()**

        *Returns:* `bool`

    -   **getRouteArguments()**

        *Returns:* `array<string,string|array>`

    -   **getPageId()**

        *Returns:* `int`

    -   **getPageType()**

        *Returns:* `string`

    -   **get(string $name)**

        -   *param $name:* the name

        *Returns:* `string|array<string,string|array>|null`

    -   **getArguments()**

        *Returns:* `array<string,string|array>`

    -   **getStaticArguments()**

        *Returns:* `array<string,string|array>`

    -   **getDynamicArguments()**

        *Returns:* `array<string,string|array>`

    -   **getQueryArguments()**

        *Returns:* `array<string,string|array>`

    -   **offsetExists(?mixed $offset)**

        -   *param $offset:* the offset

        *Returns:* `bool`

    -   **offsetGet(?mixed $offset)**

        -   *param $offset:* the offset

        *Returns:* `string|array<string,string|array>|null`

    -   **offsetSet(?mixed $offset, ?mixed $value)**

        -   *param $offset:* the offset
        -   *param $value:* the value

    -   **offsetUnset(?mixed $offset)**

        -   *param $offset:* the offset

## Backend {#typo3-request-attribute-routing-backend}

<!-- TODO: no Markdown rendering for "versionadded" -->

The `routing` backend request attribute provides routing information in
the object `\TYPO3\CMS\Backend\Routing\RouteResult`.

Example:

```php
/** @var \Psr\Http\Message\ServerRequestInterface $request */
$routing = $request->getAttribute('routing');
$arguments = $routing->getArguments()
```

> [!NOTE]
> **See also**
>
> [Dynamic URL parts in backend URLs](https://docs.typo3.org/permalink/t3coreapi:backend-routing-dynamic-parts@12.4)

### API {#api-1}

-   **class RouteResult**

    -   *Fully qualified name:* `\TYPO3\CMS\Backend\Routing\RouteResult`

    A route result for the TYPO3 Backend Routing,
    containing the matched Route and the related arguments found in the URL

    -   **getRoute()**

        *Returns:* `TYPO3CMSBackendRoutingRoute`

    -   **getRouteName()**

        *Returns:* `string`

    -   **getArguments()**

        *Returns:* `array`

    -   **offsetExists(?mixed $offset)**

        -   *param $offset:* the offset

        *Returns:* `bool`

    -   **offsetGet(?mixed $offset)**

        -   *param $offset:* the offset

        *Returns:* `?mixed`

    -   **offsetSet(?mixed $offset = '', ?mixed $value = '')**

        -   *param $offset:* the offset, default: ''
        -   *param $value:* the value, default: ''

    -   **offsetUnset(?mixed $offset)**

        -   *param $offset:* the offset
