Contao\TemplateLoader::getDefaultPath PHP Метод

getDefaultPath() публичный статический Метод

Return the path to the default template
public static getDefaultPath ( string $template, string $format ) : string
$template string The template name
$format string The output format (e.g. "html5")
Результат string The path to the default template file
    public static function getDefaultPath($template, $format)
    {
        $file = $template . '.' . $format;
        if (isset(self::$files[$template])) {
            $filesystem = \System::getContainer()->get('filesystem');
            // Make the paths absolute (backwards compatibility)
            if (!$filesystem->isAbsolutePath(self::$files[$template])) {
                return TL_ROOT . '/' . self::$files[$template];
            }
            return self::$files[$template] . '/' . $file;
        }
        $strPath = null;
        try {
            // Search for the template if it is not in the lookup array (last match wins)
            foreach (\System::getContainer()->get('contao.resource_finder')->findIn('templates')->name($file) as $file) {
                $strPath = $file->getPathname();
            }
        } catch (\InvalidArgumentException $e) {
        }
        if ($strPath !== null) {
            return $strPath;
        }
        throw new \Exception('Could not find template "' . $template . '"');
    }