PHP Class Neos\Flow\Mvc\Routing\DynamicRoutePart

Inheritance: extends AbstractRoutePart, implements Neos\Flow\Mvc\Routing\DynamicRoutePartInterface
显示文件 Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface
$splitString string If it is empty, Route Part will be equal to the remaining request path.

Public Methods

Method Description
match ( string &$routePath ) : boolean Checks whether this Dynamic Route Part corresponds to the given $routePath.
resolve ( array &$routeValues ) : boolean Checks whether $routeValues contains elements which correspond to this Dynamic Route Part.
setSplitString ( string $splitString ) : void Sets split string of the Route Part.

Protected Methods

Method Description
findValueToMatch ( string $routePath ) : string Returns the first part of $routePath.
findValueToResolve ( array $routeValues ) : string | array Returns the route value of the current route part.
matchValue ( string $value ) : boolean Checks, whether given value can be matched.
removeMatchingPortionFromRequestPath ( string &$routePath, string $valueToMatch ) : void Removes matching part from $routePath.
resolveValue ( mixed $value ) : boolean Checks, whether given value can be resolved and if so, sets $this->value to the resolved value.

Method Details

findValueToMatch() protected method

If a split string is set, only the first part of the value until location of the splitString is returned. This method can be overridden by custom RoutePartHandlers to implement custom matching mechanisms.
protected findValueToMatch ( string $routePath ) : string
$routePath string The request path to be matched
return string value to match, or an empty string if $routePath is empty or split string was not found

findValueToResolve() protected method

This method can be overridden by custom RoutePartHandlers to implement custom resolving mechanisms.
protected findValueToResolve ( array $routeValues ) : string | array
$routeValues array An array with key/value pairs to be resolved by Dynamic Route Parts.
return string | array value to resolve.

match() final public method

On successful match this method sets $this->value to the corresponding uriPart and shortens $routePath respectively.
final public match ( string &$routePath ) : boolean
$routePath string The request path to be matched - without query parameters, host and fragment.
return boolean TRUE if Route Part matched $routePath, otherwise FALSE.

matchValue() protected method

In the case of default Dynamic Route Parts a value matches when it's not empty. This method can be overridden by custom RoutePartHandlers to implement custom matching mechanisms.
protected matchValue ( string $value ) : boolean
$value string value to match
return boolean TRUE if value could be matched successfully, otherwise FALSE.

removeMatchingPortionFromRequestPath() protected method

This method can be overridden by custom RoutePartHandlers to implement custom matching mechanisms.
protected removeMatchingPortionFromRequestPath ( string &$routePath, string $valueToMatch ) : void
$routePath string The request path to be matched
$valueToMatch string The matching value
return void

resolve() final public method

If a corresponding element is found in $routeValues, this element is removed from the array.
final public resolve ( array &$routeValues ) : boolean
$routeValues array An array with key/value pairs to be resolved by Dynamic Route Parts.
return boolean TRUE if current Route Part could be resolved, otherwise FALSE

resolveValue() protected method

If $value is empty, this method checks whether a default value exists. This method can be overridden by custom RoutePartHandlers to implement custom resolving mechanisms.
protected resolveValue ( mixed $value ) : boolean
$value mixed value to resolve
return boolean TRUE if value could be resolved successfully, otherwise FALSE.

setSplitString() public method

Sets split string of the Route Part.
public setSplitString ( string $splitString ) : void
$splitString string
return void

Property Details

$persistenceManager protected_oe property

protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
return Neos\Flow\Persistence\PersistenceManagerInterface

$splitString protected_oe property

If it is empty, Route Part will be equal to the remaining request path.
protected string $splitString
return string