public function getTemplate(string $name, string $format = 'twig'): string
    {
        // Check for a theme folder
        if ($this->containerUtil->isFrontend()) {
            /* @var PageModel $objPage */
            global $objPage;

            if ('' != $objPage->templateGroup) {
                if (\Validator::isInsecurePath($objPage->templateGroup)) {
                    throw new \RuntimeException('Invalid path '.$objPage->templateGroup);
                }

                $templates = $this->findTemplates($this->containerUtil->getProjectDir().'/'.$objPage->templateGroup, $name, $format);

                if (!empty($templates)) {
                    return reset($templates);
                }
            }
        }

        if (!isset(self::$twigFiles[$name])) {
            throw new \Twig_Error_Loader(sprintf('Unable to find template "%s".', $name));
        }

        return self::$twigFiles[$name];
    }