FOF30\Template\Template::parsePath PHP Метод

parsePath() публичный Метод

For example, media://com_foobar/css/test.css is parsed into media/com_foobar/css/test.css if no override is found, or templates/mytemplate/media/com_foobar/css/test.css if the current template is called mytemplate and there's a media override for it. Regarding plugins, templates are searched inside the plugin's tmpl directory and the template's html directory. For instance considering plugin://system/example/something the files will be looked for in: plugins/system/example/tmpl/something.php templates/yourTemplate/html/plg_system_example/something.php Template paths for plugins are uncommon and not standard Joomla! practice. They make sense when you are implementing features of your component as plugins and they need to provide HTML output, e.g. some of the integration plugins we use in Akeeba Subscriptions. The valid protocols are: media:// The media directory or a media override plugin:// Given as plugin://pluginType/pluginName/template, e.g. plugin://system/example/something admin:// Path relative to administrator directory (no overrides) site:// Path relative to site's root (no overrides)
public parsePath ( string $path, boolean $localFile = false ) : string
$path string Fancy path
$localFile boolean When true, it returns the local path, not the URL
Результат string Parsed path
    public function parsePath($path, $localFile = false)
    {
        $platformDirs = $this->container->platform->getPlatformBaseDirs();
        if ($localFile) {
            $url = rtrim($platformDirs['root'], DIRECTORY_SEPARATOR) . '/';
        } else {
            $url = $this->container->platform->URIroot();
        }
        $altPaths = $this->getAltPaths($path);
        $filePath = $altPaths['normal'];
        // If JDEBUG is enabled, prefer that path, else prefer an alternate path if present
        if (defined('JDEBUG') && JDEBUG && isset($altPaths['debug'])) {
            if (file_exists($platformDirs['public'] . '/' . $altPaths['debug'])) {
                $filePath = $altPaths['debug'];
            }
        } elseif (isset($altPaths['alternate'])) {
            if (file_exists($platformDirs['public'] . '/' . $altPaths['alternate'])) {
                $filePath = $altPaths['alternate'];
            }
        }
        $url .= $filePath;
        return $url;
    }