public static function getTemplate($strTemplate, $strFormat = 'html5')
{
$arrAllowed = \StringUtil::trimsplit(',', strtolower(\Config::get('templateFiles')));
array_push($arrAllowed, 'html5');
// see #3398
if (!in_array($strFormat, $arrAllowed)) {
throw new \InvalidArgumentException('Invalid output format ' . $strFormat);
}
$strTemplate = basename($strTemplate);
// Check for a theme folder
if (TL_MODE == 'FE') {
/** @var PageModel $objPage */
global $objPage;
if ($objPage->templateGroup != '') {
if (\Validator::isInsecurePath($objPage->templateGroup)) {
throw new \RuntimeException('Invalid path ' . $objPage->templateGroup);
}
return \TemplateLoader::getPath($strTemplate, $strFormat, $objPage->templateGroup);
}
}
return \TemplateLoader::getPath($strTemplate, $strFormat);
}