protected function getRoute($controller)
    {
        $routes = $this->router->getRouteCollection()->all();
        foreach ($routes as $name => $route) {
            if ($controller === $route->getDefault('_controller')) {
                return [ $name, $route ];
            }
        }

        return null;
    }
protected function getRoute($controller)
    {
        $routes = $this->router->getRouteCollection()->all();
        foreach ($routes as $name => $route) {
            if ($controller === $route->getDefault('_controller')) {
                return [ $name, $route ];
            }
        }

        return null;
    }
protected function getRoute ( $ controller ) { $ routes = $ this -> router -> getRouteCollection ( ) -> all ( ) ; foreach ( $ routes as $ name => $ route ) { if ( $ controller === $ route -> getDefault ( '_controller' ) ) { return [ $ name , $ route ] ; } } return null ; }
Returns the route that matches the given controller name.

@param string $controller Name of the controller

@return Route
Returns the route that matches the given controller name .