getTemplateDirectories example


        if (!empty($_renderer)) {
            $this->_renderer = $_renderer;
        }
        if ($this->_valuesAssigend == false) {
            $this->assignValues();
        }

        if (!empty($this->_subshop['doc_template_id'])) {
            $template = Shopware()->Container()->get(ModelManager::class)->find(Template::class$this->_subshop['doc_template_id']);

            $inheritance = Shopware()->Container()->get('theme_inheritance')->getTemplateDirectories($template);
            $this->_template->setTemplateDir($inheritance);
        }

        $html = $this->_template->fetch('documents/' . $this->_document['template']$this->_view);

        /** @var Enlight_Event_EventManager $eventManager */
        $eventManager = Shopware()->Container()->get('events');
        $html = $eventManager->filter('Shopware_Components_Document_Render_FilterHtml', $html[
            'subject' => $this,
        ]);

        
 else {
            throw new RuntimeException(sprintf('Tried to load unsupported template version %s for template: %s', $template->getVersion()$template->getName()));
        }

        $this->container->get(Enlight_Template_Manager::class)->setCompileId(
            sprintf('frontend_%s_%s_%s', $template->toString()$localeName$shop->getId())
        );
    }

    private function registerTheme(Template $template): void
    {
        $path = $this->container->get(Inheritance::class)->getTemplateDirectories($template);
        $this->container->get(Enlight_Template_Manager::class)->setTemplateDir($path);
    }
}
Home | Imprint | This part of the site doesn't use cookies.