protected $functionCallbacks;
protected $filterCallbacks;
protected $staging;
- protected $templateClasses;
/**
* Constructor.
$this->setCache($options['cache']);
$this->functionCallbacks = array();
$this->filterCallbacks = array();
- $this->templateClasses = array();
$this->addExtension(new Twig_Extension_Core());
$this->addExtension(new Twig_Extension_Escaper($options['autoescape']));
*/
public function getTemplateClass($name, $index = null)
{
- $suffix = null === $index ? '' : '_'.$index;
- $cls = $name.$suffix;
- if (isset($this->templateClasses[$cls])) {
- return $this->templateClasses[$cls];
- }
-
- return $this->templateClasses[$cls] = $this->templateClassPrefix.hash('sha256', $this->getLoader()->getCacheKey($name)).$suffix;
+ return $this->templateClassPrefix.hash('sha256', $this->getLoader()->getCacheKey($name)).(null === $index ? '' : '_'.$index);
}
/**