core-bundle/src/Resources/contao/library/Contao/Controller.php
public static function getTemplate($strTemplate)
	{
		$strTemplate = basename($strTemplate);

		// Check for a theme folder
		if (\defined('TL_MODE') && 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, 'html5', $objPage->templateGroup);
			}
		}

		return TemplateLoader::getPath($strTemplate, 'html5');
	}
public static function getTemplate($strTemplate)
	{
		$strTemplate = basename($strTemplate);

		// Check for a theme folder
		if (\defined('TL_MODE') && 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, 'html5', $objPage->templateGroup);
			}
		}

		return TemplateLoader::getPath($strTemplate, 'html5');
	}
Find a particular template file and return its path

@param string $strTemplate The name of the template

@return string The path to the template file

@throws \RuntimeException If the template group folder is insecure