public function importResource(
        LoaderInterface $loader,
        $resource,
        array $parents = [],
        $routePrefix = null,
        $namePrefix = null,
        $type = null,
        $currentDir = null
    ) {
        $loader = $loader->resolve($resource, $type);

        if ($loader instanceof FileLoader && null !== $currentDir) {
            $resource = $loader->getLocator()->locate($resource, $currentDir);
        } elseif ($loader instanceof RestRouteLoader) {
            $loader->getControllerReader()->getActionReader()->setParents($parents);
            $loader->getControllerReader()->getActionReader()->setRoutePrefix($routePrefix);
            $loader->getControllerReader()->getActionReader()->setNamePrefix($namePrefix);
        }

        return $loader->load($resource, $type);
    }
public function importResource(
        LoaderInterface $loader,
        $resource,
        array $parents = [],
        $routePrefix = null,
        $namePrefix = null,
        $type = null,
        $currentDir = null
    ) {
        $loader = $loader->resolve($resource, $type);

        if ($loader instanceof FileLoader && null !== $currentDir) {
            $resource = $loader->getLocator()->locate($resource, $currentDir);
        } elseif ($loader instanceof RestRouteLoader) {
            $loader->getControllerReader()->getActionReader()->setParents($parents);
            $loader->getControllerReader()->getActionReader()->setRoutePrefix($routePrefix);
            $loader->getControllerReader()->getActionReader()->setNamePrefix($namePrefix);
        }

        return $loader->load($resource, $type);
    }
public function importResource ( LoaderInterface $ loader , $ resource , array $ parents = [ ] , $ routePrefix = null , $ namePrefix = null , $ type = null , $ currentDir = null ) { $ loader = $ loader -> resolve ( $ resource , $ type ) ; if ( $ loader instanceof FileLoader && null !== $ currentDir ) { $ resource = $ loader -> getLocator ( ) -> locate ( $ resource , $ currentDir ) ; } elseif ( $ loader instanceof RestRouteLoader ) { $ loader -> getControllerReader ( ) -> getActionReader ( ) -> setParents ( $ parents ) ; $ loader -> getControllerReader ( ) -> getActionReader ( ) -> setRoutePrefix ( $ routePrefix ) ; $ loader -> getControllerReader ( ) -> getActionReader ( ) -> setNamePrefix ( $ namePrefix ) ; } return $ loader -> load ( $ resource , $ type ) ; }
Import & return routes collection from a resource.

@param LoaderInterface $loader      The Loader
@param mixed           $resource    A Resource
@param array           $parents     Array of parent resources names
@param string          $routePrefix Current routes prefix
@param string          $namePrefix  Routes names prefix
@param string          $type        The resource type
@param string          $currentDir  Current directory of the loader

@return RouteCollection A RouteCollection instance
Import & return routes collection from a resource .