Routing

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:

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

API

class TYPO3\CMS\Core\Routing\PageArguments

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

areDirty()
Return type

bool

getRouteArguments()
Return type

array

Returns

array<string,string|array>

getPageId()
Return type

int

getPageType()
Return type

string

get(string $name)
Parameters
  • $name (string) -- the name

Return type

mixed

Returns

string|array<string,string|array>|null

getArguments()
Return type

array

Returns

array<string,string|array>

getStaticArguments()
Return type

array

Returns

array<string,string|array>

getDynamicArguments()
Return type

array

Returns

array<string,string|array>

getQueryArguments()
Return type

array

Returns

array<string,string|array>

offsetExists(mixed $offset)
Parameters
  • $offset (mixed) -- the offset

Return type

bool

offsetGet(mixed $offset)
Parameters
  • $offset (mixed) -- the offset

Return type

mixed

Returns

string|array<string,string|array>|null

offsetSet(mixed $offset, mixed $value)
Parameters
  • $offset (mixed) -- the offset

  • $value (mixed) -- the value

offsetUnset(mixed $offset)
Parameters
  • $offset (mixed) -- the offset

Backend

New in version 12.1.

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

Example:

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

API

class 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()
Return type

TYPO3\CMS\Backend\Routing\Route

getRouteName()
Return type

string

getArguments()
Return type

array

offsetExists(mixed $offset)
Parameters
  • $offset (mixed) -- the offset

Return type

bool

offsetGet(mixed $offset)
Parameters
  • $offset (mixed) -- the offset

Return type

mixed

offsetSet(mixed $offset = '', mixed $value = '')
Parameters
  • $offset (mixed) -- the offset, default: ''

  • $value (mixed) -- the value, default: ''

offsetUnset(mixed $offset)
Parameters
  • $offset (mixed) -- the offset