PHP Класс Neos\Flow\Mvc\Routing\Route

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$appendExceedingArguments boolean Specifies whether Route Values, that are not part of the Routes configuration, should be appended as query string
$defaults array Default values
$httpMethods If not empty only the specified HTTP verbs are accepted by this route
$isParsed boolean For better performance, routes are only parsed if needed.
$lowerCase boolean Specifies whether Route Parts of this Route should be converted to lower case when resolved.
$matchResults array Contains the routing results (indexed by "package", "controller" and "action") after a successful call of matches()
$name string Route name
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface
$resolvedUriPath string Contains the matching uri (excluding protocol and host) after a successful call of resolves()
$routeParts array Container for Route Parts.
$routePartsConfiguration array Contains associative array of Route Part options (key: Route Part name, value: array of Route Part options)
$uriPattern string URI Pattern of this route

Открытые методы

Метод Описание
getAppendExceedingArguments ( ) : boolean Returns TRUE if exceeding arguments should be appended to the URI as query string, otherwise FALSE
getDefaults ( ) : array Returns default values for this Route.
getHttpMethods ( ) : array
getMatchResults ( ) : array Returns an array with the Route match results.
getName ( ) : string Returns the name of this Route.
getResolvedUriPath ( ) : string Returns the URI path which corresponds to this Route.
getRoutePartsConfiguration ( ) : array Returns the route parts configuration of this route
getUriPattern ( ) : string Returns the URI pattern this route should match with
hasHttpMethodConstraints ( ) : boolean Whether or not this route is limited to one or more HTTP verbs
isLowerCase ( ) : boolean Getter for $this->lowerCase.
matches ( Request $httpRequest ) : boolean Checks whether $routePath corresponds to this Route.
parse ( ) : void Iterates through all segments in $this->uriPattern and creates appropriate RoutePart instances.
resolves ( array $routeValues ) : boolean Checks whether $routeValues can be resolved to a corresponding uri.
setAppendExceedingArguments ( boolean $appendExceedingArguments ) : void Specifies whether Route values, that are not part of the Route configuration, should be appended to the Resulting URI as query string.
setDefaults ( array $defaults ) : void Sets default values for this Route.
setHttpMethods ( array $httpMethods ) : void Limits the HTTP verbs that are accepted by this route.
setLowerCase ( boolean $lowerCase ) : void Specifies whether Route parts of this route should be converted to lower case when resolved.
setName ( string $name ) : void Sets Route name.
setRoutePartsConfiguration ( array $routePartsConfiguration ) : void By default all Dynamic Route Parts are resolved by \Neos\Flow\Mvc\Routing\DynamicRoutePart.
setUriPattern ( string $uriPattern ) : void Sets the URI pattern this route should match with

Защищенные методы

Метод Описание
compareAndRemoveMatchingDefaultValues ( array $defaults, array &$routeValues ) : boolean Recursively iterates through the defaults of this route.
containsObject ( mixed $subject ) : boolean Checks if the given subject contains an object
extractInternalArguments ( array &$arguments ) : array Removes all internal arguments (prefixed with two underscores) from the given $arguments and returns them as array

Описание методов

compareAndRemoveMatchingDefaultValues() защищенный Метод

If a route value is equal to a default value, it's removed from $routeValues. If a value exists but is not equal to is corresponding default, iteration is interrupted and FALSE is returned.
protected compareAndRemoveMatchingDefaultValues ( array $defaults, array &$routeValues ) : boolean
$defaults array
$routeValues array
Результат boolean FALSE if one of the $routeValues is not equal to it's default value. Otherwise TRUE

containsObject() защищенный Метод

Checks if the given subject contains an object
protected containsObject ( mixed $subject ) : boolean
$subject mixed
Результат boolean If it contains an object or not

extractInternalArguments() защищенный Метод

Removes all internal arguments (prefixed with two underscores) from the given $arguments and returns them as array
protected extractInternalArguments ( array &$arguments ) : array
$arguments array
Результат array the internal arguments

getAppendExceedingArguments() публичный Метод

Returns TRUE if exceeding arguments should be appended to the URI as query string, otherwise FALSE
public getAppendExceedingArguments ( ) : boolean
Результат boolean

getDefaults() публичный Метод

Returns default values for this Route.
public getDefaults ( ) : array
Результат array Route defaults

getHttpMethods() публичный Метод

public getHttpMethods ( ) : array
Результат array

getMatchResults() публичный Метод

Returns an array with the Route match results.
См. также: Neos\Flow\Mvc\Routing\Router
public getMatchResults ( ) : array
Результат array An array of Route Parts and their values for further handling by the Router

getName() публичный Метод

Returns the name of this Route.
public getName ( ) : string
Результат string Route name.

getResolvedUriPath() публичный Метод

Returns the URI path which corresponds to this Route.
public getResolvedUriPath ( ) : string
Результат string A string containing the corresponding uri (excluding protocol and host)

getRoutePartsConfiguration() публичный Метод

Returns the route parts configuration of this route
public getRoutePartsConfiguration ( ) : array
Результат array $routePartsConfiguration

getUriPattern() публичный Метод

Returns the URI pattern this route should match with
public getUriPattern ( ) : string
Результат string the URI pattern

hasHttpMethodConstraints() публичный Метод

Whether or not this route is limited to one or more HTTP verbs
public hasHttpMethodConstraints ( ) : boolean
Результат boolean

isLowerCase() публичный Метод

Getter for $this->lowerCase.
См. также: setLowerCase()
public isLowerCase ( ) : boolean
Результат boolean TRUE if this Route part will be converted to lower case, otherwise FALSE.

matches() публичный Метод

If all Route Parts match successfully TRUE is returned and $this->matchResults contains an array combining Route default values and calculated matchResults from the individual Route Parts.
См. также: getMatchResults()
public matches ( Request $httpRequest ) : boolean
$httpRequest Neos\Flow\Http\Request the HTTP request to match
Результат boolean TRUE if this Route corresponds to the given $routePath, otherwise FALSE

parse() публичный Метод

Iterates through all segments in $this->uriPattern and creates appropriate RoutePart instances.
public parse ( ) : void
Результат void

resolves() публичный Метод

If all Route Parts can resolve one or more of the $routeValues, TRUE is returned and $this->matchingURI contains the generated URI (excluding protocol and host).
public resolves ( array $routeValues ) : boolean
$routeValues array An array containing key/value pairs to be resolved to uri segments
Результат boolean TRUE if this Route corresponds to the given $routeValues, otherwise FALSE

setAppendExceedingArguments() публичный Метод

If set to FALSE, the route won't resolve if there are route values left after iterating through all Route Part handlers and removing the matching default values.
public setAppendExceedingArguments ( boolean $appendExceedingArguments ) : void
$appendExceedingArguments boolean TRUE: exceeding arguments will be appended to the resulting URI
Результат void

setDefaults() публичный Метод

This array is merged with the actual matchResults when match() is called.
public setDefaults ( array $defaults ) : void
$defaults array
Результат void

setHttpMethods() публичный Метод

If empty all HTTP verbs are accepted
public setHttpMethods ( array $httpMethods ) : void
$httpMethods array non-associative array in the format array('GET', 'POST', ...)
Результат void

setLowerCase() публичный Метод

This setting can be overwritten for all dynamic Route parts.
public setLowerCase ( boolean $lowerCase ) : void
$lowerCase boolean TRUE: Route parts are converted to lower case by default. FALSE: Route parts are not altered.
Результат void

setName() публичный Метод

Sets Route name.
public setName ( string $name ) : void
$name string The Route name
Результат void

setRoutePartsConfiguration() публичный Метод

But you can specify different classes to handle particular Route Parts. Note: Route Part handlers must implement \Neos\Flow\Mvc\Routing\DynamicRoutePartInterface. Usage: setRoutePartsConfiguration(array('@controller' => array('handler' => \Neos\Package\Subpackage\MyRoutePartHandler::class)));
public setRoutePartsConfiguration ( array $routePartsConfiguration ) : void
$routePartsConfiguration array Route Parts configuration options
Результат void

setUriPattern() публичный Метод

Sets the URI pattern this route should match with
public setUriPattern ( string $uriPattern ) : void
$uriPattern string
Результат void

Описание свойств

$appendExceedingArguments защищенное свойство

Specifies whether Route Values, that are not part of the Routes configuration, should be appended as query string
protected bool $appendExceedingArguments
Результат boolean

$defaults защищенное свойство

Default values
protected array $defaults
Результат array

$httpMethods защищенное свойство

If not empty only the specified HTTP verbs are accepted by this route
protected $httpMethods

$isParsed защищенное свойство

For better performance, routes are only parsed if needed.
protected bool $isParsed
Результат boolean

$lowerCase защищенное свойство

Specifies whether Route Parts of this Route should be converted to lower case when resolved.
protected bool $lowerCase
Результат boolean

$matchResults защищенное свойство

Contains the routing results (indexed by "package", "controller" and "action") after a successful call of matches()
protected array $matchResults
Результат array

$name защищенное свойство

Route name
protected string $name
Результат string

$objectManager защищенное свойство

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
Результат Neos\Flow\ObjectManagement\ObjectManagerInterface

$persistenceManager защищенное свойство

protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
Результат Neos\Flow\Persistence\PersistenceManagerInterface

$resolvedUriPath защищенное свойство

Contains the matching uri (excluding protocol and host) after a successful call of resolves()
protected string $resolvedUriPath
Результат string

$routeParts защищенное свойство

Container for Route Parts.
protected array $routeParts
Результат array

$routePartsConfiguration защищенное свойство

Contains associative array of Route Part options (key: Route Part name, value: array of Route Part options)
protected array $routePartsConfiguration
Результат array

$uriPattern защищенное свойство

URI Pattern of this route
protected string $uriPattern
Результат string