TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Backend\Routing\Route Class Reference

Public Member Functions

 __construct ($path, $options)
 
 getPath ()
 
 setPath ($pattern)
 
 getOptions ()
 
 setOptions (array $options)
 
 setOption ($name, $value)
 
 getOption ($name)
 
 hasOption ($name)
 

Protected Attributes

 $path = '/'
 
 $options = []
 

Detailed Description

This is a single entity for a Route.

The architecture is highly inspired by the Symfony Routing Component.

Definition at line 22 of file Route.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Routing\Route::__construct (   $path,
  $options 
)

Constructor setting up the required path and options

Parameters
string$pathThe path pattern to match
array$optionsAn array of options

Definition at line 40 of file Route.php.

References TYPO3\CMS\Backend\Routing\Route\$options, TYPO3\CMS\Backend\Routing\Route\$path, and TYPO3\CMS\Backend\Routing\Route\setPath().

Member Function Documentation

◆ getOption()

TYPO3\CMS\Backend\Routing\Route::getOption (   $name)

Get an option value

Parameters
string$nameAn option name
Returns
mixed The option value or NULL when not given

Definition at line 116 of file Route.php.

◆ getOptions()

TYPO3\CMS\Backend\Routing\Route::getOptions ( )

Returns the options set

Returns
array The options

Definition at line 76 of file Route.php.

References TYPO3\CMS\Backend\Routing\Route\$options.

◆ getPath()

TYPO3\CMS\Backend\Routing\Route::getPath ( )

Returns the path

Returns
string The path pattern

Definition at line 50 of file Route.php.

References TYPO3\CMS\Backend\Routing\Route\$path.

◆ hasOption()

TYPO3\CMS\Backend\Routing\Route::hasOption (   $name)

Checks if an option has been set

Parameters
string$nameAn option name
Returns
bool TRUE if the option is set, FALSE otherwise

Definition at line 127 of file Route.php.

◆ setOption()

TYPO3\CMS\Backend\Routing\Route::setOption (   $name,
  $value 
)

Sets an option value

This method implements a fluent interface.

Parameters
string$nameAn option name
mixed$valueThe option value
Returns
Route The current Route instance

Definition at line 104 of file Route.php.

◆ setOptions()

TYPO3\CMS\Backend\Routing\Route::setOptions ( array  $options)

Sets the options

This method implements a fluent interface.

Parameters
array$optionsThe options
Returns
Route The current Route instance

Definition at line 89 of file Route.php.

References TYPO3\CMS\Backend\Routing\Route\$options.

◆ setPath()

TYPO3\CMS\Backend\Routing\Route::setPath (   $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.

Parameters
string$patternThe path pattern
Returns
Route The current Route instance

Definition at line 65 of file Route.php.

Referenced by TYPO3\CMS\Backend\Routing\Route\__construct().

Member Data Documentation

◆ $options

TYPO3\CMS\Backend\Routing\Route::$options = []
protected

◆ $path

TYPO3\CMS\Backend\Routing\Route::$path = '/'
protected