DataCollector/RoutingDataCollector.php
public function collect(Request $request, Response $response, \Exception $exception = null)
    {
        $collection = $this->router->getRouteCollection();
        $_ressources = $collection->getResources();
        $_routes = $collection->all();

        $routes = array();
        $ressources = array();

        foreach ($_ressources as $ressource) {
            $ressources[] = array(
                'type' => get_class($ressource),
                'path' => $ressource->__toString()
            );
        }

        foreach ($_routes as $routeName => $route) {
            $defaults = $route->getDefaults();
            $requirements = $route->getRequirements();

            $controller = isset($defaults['_controller']) ? $defaults['_controller'] : 'unknown';
            $routes[$routeName] = array(
                'name' => $routeName,
                'pattern' => $route->getPath(),
                'controller' => $controller,
                'method' => isset($requirements['_method']) ? $requirements['_method'] : 'ANY',
            );
        }
        ksort($routes);
        $this->data['matchRoute'] = $request->attributes->get('_route');
        $this->data['routes'] = $routes;
        $this->data['ressources'] = $ressources;
    }
public function collect(Request $request, Response $response, \Exception $exception = null)
    {
        $collection = $this->router->getRouteCollection();
        $_ressources = $collection->getResources();
        $_routes = $collection->all();

        $routes = array();
        $ressources = array();

        foreach ($_ressources as $ressource) {
            $ressources[] = array(
                'type' => get_class($ressource),
                'path' => $ressource->__toString()
            );
        }

        foreach ($_routes as $routeName => $route) {
            $defaults = $route->getDefaults();
            $requirements = $route->getRequirements();

            $controller = isset($defaults['_controller']) ? $defaults['_controller'] : 'unknown';
            $routes[$routeName] = array(
                'name' => $routeName,
                'pattern' => $route->getPath(),
                'controller' => $controller,
                'method' => isset($requirements['_method']) ? $requirements['_method'] : 'ANY',
            );
        }
        ksort($routes);
        $this->data['matchRoute'] = $request->attributes->get('_route');
        $this->data['routes'] = $routes;
        $this->data['ressources'] = $ressources;
    }
public function collect ( Request $ request , Response $ response , \ Exception $ exception = null ) { $ collection = $ this -> router -> getRouteCollection ( ) ; $ _ressources = $ collection -> getResources ( ) ; $ _routes = $ collection -> all ( ) ; $ routes = array ( ) ; $ ressources = array ( ) ; foreach ( $ _ressources as $ ressource ) { $ ressources [ ] = array ( 'type' => get_class ( $ ressource ) , 'path' => $ ressource -> __toString ( ) ) ; } foreach ( $ _routes as $ routeName => $ route ) { $ defaults = $ route -> getDefaults ( ) ; $ requirements = $ route -> getRequirements ( ) ; $ controller = isset ( $ defaults [ '_controller' ] ) ? $ defaults [ '_controller' ] : 'unknown' ; $ routes [ $ routeName ] = array ( 'name' => $ routeName , 'pattern' => $ route -> getPath ( ) , 'controller' => $ controller , 'method' => isset ( $ requirements [ '_method' ] ) ? $ requirements [ '_method' ] : 'ANY' , ) ; } ksort ( $ routes ) ; $ this -> data [ 'matchRoute' ] = $ request -> attributes -> get ( '_route' ) ; $ this -> data [ 'routes' ] = $ routes ; $ this -> data [ 'ressources' ] = $ ressources ; }
Collects the Information on the Route

@param Request    $request   The Request Object
@param Response   $response  The Response Object
@param \Exception $exception The Exception
Collects the Information on the Route