TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
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 (   $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 Route\$options, Route\$path, and Route\setPath().

Member Function Documentation

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 ( )

Returns the options set

Returns
array The options

Definition at line 76 of file Route.php.

References Route\$options.

getPath ( )

Returns the path

Returns
string The path pattern

Definition at line 50 of file Route.php.

References Route\$path.

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 (   $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 ( 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 Route\$options.

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 Route\__construct().

Member Data Documentation

$options = []
protected

Definition at line 32 of file Route.php.

Referenced by Route\__construct(), Route\getOptions(), and Route\setOptions().

$path = '/'
protected

Definition at line 27 of file Route.php.

Referenced by Route\__construct(), and Route\getPath().