Route

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

Example:

$route = $request->getAttribute('route');
$moduleConfiguration = $route->getOption('moduleConfiguration');
Copied!

API

class Route
Fully qualified name
\TYPO3\CMS\Backend\Routing\Route

This is a single entity for a Route.

The architecture is highly inspired by the Symfony Routing Component.

getPath ( )

Returns the path

Return description

The path pattern

Returns
string
setPath ( ?string $pattern)

Sets the pattern for the path A pattern must start with a slash and must not have multiple slashes at the beginning because the generated path for this route would be confused with a network path, e.g. '//domain.com/path'.

This method implements a fluent interface.

param $pattern

The path pattern

Return description

The current Route instance

Returns
\Route
getMethods ( )

Returns the uppercased HTTP methods this route is restricted to.

An empty array means that any method is allowed.

Return description

The methods

Returns
string[]
setMethods ( array $methods)

Sets the HTTP methods (e.g. ['POST']) this route is restricted to.

An empty array means that any method is allowed.

This method implements a fluent interface.

param $methods

The array of allowed methods

Returns
self
getOptions ( )

Returns the options set

Return description

The options

Returns
array
setOptions ( array $options)

Sets the options

This method implements a fluent interface.

param $options

The options

Return description

The current Route instance

Returns
\Route
setOption ( ?string $name, ?mixed $value)

Sets an option value

This method implements a fluent interface.

param $name

An option name

param $value

The option value

Return description

The current Route instance

Returns
\Route
getOption ( ?string $name)

Get an option value

param $name

An option name

Return description

The option value or NULL when not given

Returns
mixed
hasOption ( ?string $name)

Checks if an option has been set

param $name

An option name

Return description

TRUE if the option is set, FALSE otherwise

Returns
bool