PHP 클래스 Neos\Flow\Mvc\Routing\Route

파일 보기 프로젝트 열기: neos/flow-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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

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

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