PHP Class Neos\Flow\Mvc\Routing\Router

Inheritance: implements Neos\Flow\Mvc\Routing\RouterInterface
Afficher le fichier Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$configurationManager Neos\Flow\Configuration\ConfigurationManager
$lastMatchedRoute Route
$lastResolvedRoute Route
$routerCachingService RouterCachingService
$routes array Array of routes to match against
$routesConfiguration array Array containing the configuration for all routes
$routesCreated boolean TRUE if route object have been created, otherwise FALSE
$systemLogger Neos\Flow\Log\SystemLoggerInterface

Méthodes publiques

Méthode Description
addRoute ( Route $route ) : void Manually adds a route to the beginning of the configured routes
getLastMatchedRoute ( ) : Route Returns the route that has been matched with the last route() call.
getLastResolvedRoute ( ) : Route Returns the route that has been resolved with the last resolve() call.
getRoutes ( ) : array Returns a list of configured routes
resolve ( array $routeValues ) : string Builds the corresponding uri (excluding protocol and host) by iterating through all configured routes and calling their respective resolves() method. If no matching route is found, an empty string is returned.
route ( Request $httpRequest ) : array Iterates through all configured routes and calls matches() on them.
setRoutesConfiguration ( array $routesConfiguration = null ) : void Sets the routes configuration.

Méthodes protégées

Méthode Description
createRoutesFromConfiguration ( ) : void Creates \Neos\Flow\Mvc\Routing\Route objects from the injected routes configuration.
initializeRoutesConfiguration ( ) : void Checks if a routes configuration was set and otherwise loads the configuration from the configuration manager.

Method Details

addRoute() public méthode

Manually adds a route to the beginning of the configured routes
public addRoute ( Route $route ) : void
$route Route
Résultat void

createRoutesFromConfiguration() protected méthode

Creates \Neos\Flow\Mvc\Routing\Route objects from the injected routes configuration.
protected createRoutesFromConfiguration ( ) : void
Résultat void

getLastMatchedRoute() public méthode

Returns NULL if no route matched or route() has not been called yet
public getLastMatchedRoute ( ) : Route
Résultat Route

getLastResolvedRoute() public méthode

Returns NULL if no route was found or resolve() has not been called yet
public getLastResolvedRoute ( ) : Route
Résultat Route

getRoutes() public méthode

Returns a list of configured routes
public getRoutes ( ) : array
Résultat array

initializeRoutesConfiguration() protected méthode

Checks if a routes configuration was set and otherwise loads the configuration from the configuration manager.
protected initializeRoutesConfiguration ( ) : void
Résultat void

resolve() public méthode

Note: calls of this message are cached by RouterCachingAspect
public resolve ( array $routeValues ) : string
$routeValues array Key/value pairs to be resolved. E.g. array('@package' => 'MyPackage', '@controller' => 'MyController');
Résultat string

route() public méthode

Returns the matchResults of the matching route or NULL if no matching route could be found.
public route ( Request $httpRequest ) : array
$httpRequest Neos\Flow\Http\Request The web request to be analyzed. Will be modified by the router.
Résultat array The results of the matching route or NULL if no route matched

setRoutesConfiguration() public méthode

Sets the routes configuration.
public setRoutesConfiguration ( array $routesConfiguration = null ) : void
$routesConfiguration array The routes configuration or NULL if it should be fetched from configuration
Résultat void

Property Details

$configurationManager protected_oe property

protected ConfigurationManager,Neos\Flow\Configuration $configurationManager
Résultat Neos\Flow\Configuration\ConfigurationManager

$lastMatchedRoute protected_oe property

protected Route,Neos\Flow\Mvc\Routing $lastMatchedRoute
Résultat Route

$lastResolvedRoute protected_oe property

protected Route,Neos\Flow\Mvc\Routing $lastResolvedRoute
Résultat Route

$routerCachingService protected_oe property

protected RouterCachingService,Neos\Flow\Mvc\Routing $routerCachingService
Résultat RouterCachingService

$routes protected_oe property

Array of routes to match against
protected array $routes
Résultat array

$routesConfiguration protected_oe property

Array containing the configuration for all routes
protected array $routesConfiguration
Résultat array

$routesCreated protected_oe property

TRUE if route object have been created, otherwise FALSE
protected bool $routesCreated
Résultat boolean

$systemLogger protected_oe property

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
Résultat Neos\Flow\Log\SystemLoggerInterface