Подмешивание темы модуля в ключ кеша.

Returns a full path for a given file.

@param TemplateReferenceInterface $template A template

@return string The full path for the file
12785
protected function getCacheKey($template)
    {
        $name = $template->getLogicalName();

        if ($this->activeTheme) {
            $name .= '|module_theme='.$this->getLocator()->getModuleTheme().'|active_theme'.$this->activeTheme->getName();
        }

        return $name;
    }
522291
private function loadTemplate($template)
    {
        if (!array_key_exists($template, $this->templateCache)) {
            $this->templateCache[$template] = $this->twig->loadTemplate($template);
        }

        return $this->templateCache[$template];
    }
534368
public function setTemplate($template)
    {
        if (!(is_string($template) || $template instanceof TemplateReferenceInterface)) {
            throw new \InvalidArgumentException('The template should be a string or implement TemplateReferenceInterface');
        }
        $this->template = $template;

        return $this;
    }
207655
private function tryCompile($template)
    {
        $cache = $this->getMaskedFileName($template);
        $path = $this->getConfig('cache_folder');

        if (! file_exists($path)) {
            mkdir($path, 0777, true); // recursive path creating
        }

        if (file_exists($cache) && (filemtime($cache) > filemtime($template))) {
            // CACHED
        } else {
            $this->writeToFile(
                $cache,
                $this->compile($template),
                $this->getFile()
            );
        }

        return $this->readBuffer($cache);
    }
678833
private function scanFor($template)
    {
        $in = $this->dirs;
        $found = false;
        while (! $found && ! empty($in)) {
            $dir = array_shift($in);
            $found = $this->exists($dir, $template);
        }

        return $found;
    }
4919
protected function getTemplateVars(TemplateInterface $template)
    {
        $vars = [
            'expected' => $this->match->getExpected(),
            'actual' => $this->match->getActual(),
        ];

        if ($tplVars = $template->getTemplateVars()) {
            $vars = array_merge($vars, $tplVars);
        }

        return $vars;
    }
619551
public function find(string $templatePath)
    {
        foreach ($this->paths as $path) {
            $filePath = sprintf(
                '%s/%s',
                rtrim($path, '/'),
                ltrim($templatePath, '/')
            );

            if (is_file($filePath)) {
                return $filePath;
            }
        }

        return null;
    }
1151184
private function resolveTemplate(GridInterface $grid, $template)
    {
        if ($grid->hasOption($option = $template.'_template')) {
            return $grid->getOption($option);
        }

        if (isset($this->templates[$template])) {
            return $this->templates[$template];
        }

        return '@LugGrid/'.$template.'.html.twig';
    }
163778
public function getTemplateFilePath($templateName)
    {
        $templateList = array_merge(
            [ $this ],
            $this->getParentList()
        );

        /** @var TemplateDefinition $templateDefinition */
        foreach ($templateList as $templateDefinition) {
            $templateFilePath = sprintf(
                '%s%s/%s',
                THELIA_TEMPLATE_DIR,
                $templateDefinition->getPath(),
                $templateName
            );

            if (file_exists($templateFilePath)) {
                return $templateFilePath;
            }
        }

        throw new TemplateException("Template file not found: $templateName");
    }
1267944
public function selectTemplate($template)
    {
        if (is_null($template)) {
            return 'default';
        }

        if (!array_key_exists($template, $this->templates)) {
            throw new RuntimeException("Template \"{$template}\" is not registered");
        }

        return $template;
    }
1253768
public function load(TemplateReferenceInterface $template)
    {
        foreach ($this->loaders as $loader) {
            if (false !== $storage = $loader->load($template)) {
                return $storage;
            }
        }

        return false;
    }
323735
protected function findTwigFile($path, $template = null)
    {
        if ($template == null) {
            $template = $this->template;
        }

        return '::' . Html::TWIG_TEMPLATE_PATH . '/' . $template . '/' . $path;
    }
804930
public function find($template)
    {
        is_array($template) and $template = array_filter($template, 'is_string');
        if ((! is_string($template) && ! is_array($template)) || empty($template)) {
            throw new InvalidArgumentException(
                'Template name must be a string or an array of strings.'
            );
        }
        if (is_array($template)) {
            return $this->findMany($template);
        }
        $parse = $this->parseName($template);
        if ($parse['dir']) {
            return $this->findInDir($parse['dir'], $parse['file']);
        }

        return $parse['file'] ? $this->scanFor($parse['file']) : false;
    }
543759
private function fetchTemplate($template)
    {
        $resolver = $this->getResolver();
        $content  = $resolver->resolve($template);

        if (! $content) {
            throw new Exception\TemplateNotFoundException('Template by name "' . $template . '" not found');
        }

        return $content;
    }
50681
private function templatePath($templateName)
    {
        foreach (array_reverse($this->templateFolderList) as $templateFolder) {
            $templatePath = sprintf('%s/%s.php', $templateFolder, $templateName);
            if (file_exists($templatePath)) {
                return $templatePath;
            }
        }

        throw new TplException(sprintf('template "%s" does not exist', $templateName));
    }
507557
protected function _getCustomTemplateFilename() {
        $filePath = $this->_formatTemplate(
            Mage::getStoreConfig('turpentine_varnish/servers/custom_vcl_template'),
            array('root_dir' => Mage::getBaseDir())
        );
        if (is_file($filePath)) { return $filePath; } else { return null; }
    }
1122849
protected function getTemplatePath()
    {
        if (!isset($this->templatePath)) {
            $this->templatePath = self::$config->templates[$this->template] . '/' . $this->name;
        }

        return $this->templatePath;
    }