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 ( ) ¶
-
- returntype
-
bool
- getRouteArguments ( ) ¶
-
- returntype
-
array
- Returns:
-
array<string,string|array>
- getPageId ( ) ¶
-
- returntype
-
int
- getPageType ( ) ¶
-
- returntype
-
string
- get ( string $name) ¶
-
- param string $name
-
the name
- returntype
-
mixed
- Returns:
-
string|array<string,string|array>|null
- getArguments ( ) ¶
-
- returntype
-
array
- Returns:
-
array<string,string|array>
- getStaticArguments ( ) ¶
-
- returntype
-
array
- Returns:
-
array<string,string|array>
- getDynamicArguments ( ) ¶
-
- returntype
-
array
- Returns:
-
array<string,string|array>
- getQueryArguments ( ) ¶
-
- returntype
-
array
- Returns:
-
array<string,string|array>
- offsetExists ( mixed $offset) ¶
-
- param mixed $offset
-
the offset
- returntype
-
bool
- offsetGet ( mixed $offset) ¶
-
- param mixed $offset
-
the offset
- returntype
-
mixed
- Returns:
-
string|array<string,string|array>|null
- offsetSet ( mixed $offset, mixed $value) ¶
-
- param mixed $offset
-
the offset
- param mixed $value
-
the value
- offsetUnset ( mixed $offset) ¶
-
- param mixed $offset
-
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()
See also
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 ( ) ¶
-
- returntype
-
TYPO3\CMS\Backend\Routing\Route
- getRouteName ( ) ¶
-
- returntype
-
string
- getArguments ( ) ¶
-
- returntype
-
array
- offsetExists ( mixed $offset) ¶
-
- param mixed $offset
-
the offset
- returntype
-
bool
- offsetGet ( mixed $offset) ¶
-
- param mixed $offset
-
the offset
- returntype
-
mixed
- offsetSet ( mixed $offset = '', mixed $value = '') ¶
-
- param mixed $offset
-
the offset, default: ''
- param mixed $value
-
the value, default: ''
- offsetUnset ( mixed $offset) ¶
-
- param mixed $offset
-
the offset