src/Control/SimpleResourceURLGenerator.php
protected function resolveModuleResource(ModuleResource $resource)
    {
        // Load from module resource
        $relativePath = $resource->getRelativePath();
        $exists = $resource->exists();
        $absolutePath = $resource->getPath();

        // Rewrite to _resources with public directory
        if (Director::publicDir()) {
            // All resources mapped directly to _resources/
            $relativePath = Path::join(RESOURCES_DIR, $relativePath);
        } elseif (stripos($relativePath, ManifestFileFinder::VENDOR_DIR . DIRECTORY_SEPARATOR) === 0) {
            // @todo Non-public dir support will be removed in 5.0, so remove this block there
            // If there is no public folder, map to _resources/ but trim leading vendor/ too (4.0 compat)
            $relativePath = Path::join(
                RESOURCES_DIR,
                substr($relativePath, strlen(ManifestFileFinder::VENDOR_DIR))
            );
        }
        return [$exists, $absolutePath, $relativePath];
    }
protected function resolveModuleResource(ModuleResource $resource)
    {
        // Load from module resource
        $relativePath = $resource->getRelativePath();
        $exists = $resource->exists();
        $absolutePath = $resource->getPath();

        // Rewrite to _resources with public directory
        if (Director::publicDir()) {
            // All resources mapped directly to _resources/
            $relativePath = Path::join(RESOURCES_DIR, $relativePath);
        } elseif (stripos($relativePath, ManifestFileFinder::VENDOR_DIR . DIRECTORY_SEPARATOR) === 0) {
            // @todo Non-public dir support will be removed in 5.0, so remove this block there
            // If there is no public folder, map to _resources/ but trim leading vendor/ too (4.0 compat)
            $relativePath = Path::join(
                RESOURCES_DIR,
                substr($relativePath, strlen(ManifestFileFinder::VENDOR_DIR))
            );
        }
        return [$exists, $absolutePath, $relativePath];
    }
protected function resolveModuleResource ( ModuleResource $ resource ) { // Load from module resource $ relativePath = $ resource -> getRelativePath ( ) ; $ exists = $ resource -> exists ( ) ; $ absolutePath = $ resource -> getPath ( ) ; // Rewrite to _resources with public directory if ( Director :: publicDir ( ) ) { // All resources mapped directly to _resources/ $ relativePath = Path :: join ( RESOURCES_DIR , $ relativePath ) ; } elseif ( stripos ( $ relativePath , ManifestFileFinder :: VENDOR_DIR . DIRECTORY_SEPARATOR ) === 0 ) { // @todo Non-public dir support will be removed in 5.0, so remove this block there // If there is no public folder, map to _resources/ but trim leading vendor/ too (4.0 compat) $ relativePath = Path :: join ( RESOURCES_DIR , substr ( $ relativePath , strlen ( ManifestFileFinder :: VENDOR_DIR ) ) ) ; } return [ $ exists , $ absolutePath , $ relativePath ] ; }
Update relative path for a module resource

@param ModuleResource $resource
@return array List of [$exists, $absolutePath, $relativePath]
Update relative path for a module resource