Get a relative path to a file in a theme's public directory.

@param string $file
@param string $theme

@return string
436084
public static function pub($file, $theme = null)
    {
        $theme = $theme ?: static::activeThemeName();

        return "/vendor/boomcms/themes/$theme/".ltrim(trim($file), '/');
    }
370921
public function symlinkWithFindInherit($theme)
    {
        $trace = debug_backtrace();

        if (! isset($trace[1])) return;

        // change backslash to forward slash (for windows file system)
        $path = str_replace("\\", "/", array_get($trace[1], 'file'));

        $config = $this->getConfig();

        $link = preg_replace("#(public/{$config['themeDir']}/)[^/]+#", "$1{$theme}", $path);

        extract($this->arguments);
        extract($this->view->getShared());

        return require($link);
    }
1075284
protected function locateFile($file)
    {
        $this->locateFile && $file = call_user_func($this->locateFile, $file);

        return $file;
    }
1204678
public function getTemplateRelativePath($template)
	{
	    $rootPath = Config::getRootPath();
	    return str_replace($rootPath, '', $this->getTemplatePath()) . $this->_getRelativeTemplate($template) . $this->getSuffix();
	}
832024
def get_path():
    
    # Theme directory is defined as our parent directory
    return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
297701
public function themePath(string $resource): string
    {
        if (null === $this->theme) {
            return $resource;
        }

        if (file_exists($this->sourceDirectory.'/'.$resource)) {
            return $resource;
        }

        $themeResource = $this->findThemeResource($this->theme, $resource);
        if (null !== $themeResource) {
            return $themeResource;
        }

        if (isset($this->theme['parent'])) {
            $themeResource = $this->findThemeResource($this->theme['parent'], $resource);
            if (null !== $themeResource) {
                return $themeResource;
            }
        }

        return $resource;
    }
350034
public function path($file = null)
    {
        $base_path = Composer::getRootPath();

        $pieces = explode('/', $file);

        # Add public to the path

        array_splice($pieces, 2, 0, 'public');

        $vendor_path = implode('/', $pieces);

        if(is_file($base_path.'/workbench/'. $vendor_path)){
            return $base_path.'/workbench/'. $vendor_path;
        } elseif(is_file($base_path.'/vendor/'. $vendor_path)){
            return $base_path.'/vendor/'. $vendor_path;
        } else {
            foreach($this->_paths as $path){
                $currentPath = $base_path.'/'.$path.'/'. $file;
                if (is_file($currentPath)) {
                    return $currentPath;
                }
            }
        }

        return false;
    }
797763
private function createPath($dir, $path, $module, $theme = null)
    {
        if ($theme !== null) {
            return sprintf('%s/%s/%s/%s/%s', $path, self::TEMPLATE_PARAM_MODULES_DIR, $module, $dir, $theme);
        } else {
            return sprintf('%s/%s/%s/%s', $path, self::TEMPLATE_PARAM_MODULES_DIR, $module, $dir);
        }
    }
1263531
public static function getRelativeFilepath($file)
    {
        $storageDir = self::convertSlashes(config('filer.path.absolute'));
        $absolutePath = self::convertSlashes($file->getRealPath());
        return dirname(str_replace($storageDir, '', $absolutePath));
    }
94102
public static function keyPath($file)
    {
        $file = ltrim($file, '/\\');

        return static::$keyPath
            ? rtrim(static::$keyPath, '/\\').DIRECTORY_SEPARATOR.$file
            : storage_path($file);
    }
609532
public function theme($path)
    {
        $path = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $path);

        if (is_file($filePath = PATH_THEME . $path)) {
            return path_to_url($filePath);
        }
    }
812651
protected function absolutePath(string $file, string $base): string
    {
        return $file[0] !== DIRECTORY_SEPARATOR && !str_contains($file, ':')
            ? $base . DIRECTORY_SEPARATOR . $file
            : $file;
    }
422204
private function getFullPath(string $file = null): string
	{
		return $this->getBasePath() . $this->path . ($file !== null ? DIRECTORY_SEPARATOR . $file : '');
	}
844731
protected function getBasePath(Theme $theme = null) : string
    {
        $theme = $theme ?? $this->getTheme();

        if (isset($this->fullPaths[$theme->getKey()])) {
            return $this->fullPaths[$theme->getKey()];
        }

        return $this->fullPaths[$theme->getKey()] = $this->createPath($theme->getPath(), $this->directory);
    }
1261889
public static function find($theme)
    {
        $paths = App::path('Plugin');
        foreach ($paths as $path) {
            $path = FS::clean($path . '/', DS);
            $themeFolder = $path . $theme;

            if (FS::isDir($themeFolder)) {
                return $themeFolder;
            }
        }

        return Configure::read('plugins.' . $theme);
    }
734158
protected function getFile($file)
    {
        $mapping = [
            '%environment%' => $this->runtime->getEnvironment(),
        ];

        if ($this->runtime->getHostName() !== null) {
            $mapping['%host%'] = $this->runtime->getHostName();
        }

        if ($this->runtime->getReleaseId() !== null) {
            $mapping['%release%'] = $this->runtime->getReleaseId();
        }

        $options = $this->getOptions();
        return str_replace(
            array_keys($mapping),
            array_values($mapping),
            $options[$file]
        );
    }
1272167
public function getFilePath($fileName = null)
    {
        if ($fileName === null) {
            $fileName = $this->fileName;
        }

        return $this->theme->getPath().'/'.$this->dirName.'/'.$fileName;
    }