{
return $this->env;
}
+
+ public function getTemplateName($name)
+ {
+ return $this->getEnvironment()->getLoader()->getTemplateName($name);
+ }
}
->string($this->macro)
->raw(");\n\n")
->write("if (!class_exists(")
- ->string('__TwigMacro_'.md5($this->macro))
+ ->string($compiler->getTemplateName($this->macro).'_Macro')
->raw("))\n")
->write("{\n")
->indent()
->write("}\n")
->write(sprintf("\$context["))
->string($this->var)
- ->raw(sprintf("] = new __TwigMacro_%s(\$this->env);\n", md5($this->macro)))
+ ->raw(sprintf("] = new %s_Macro(\$this->env);\n", $compiler->getTemplateName($this->macro)))
;
}
$compiler
->write("/* $this->filename */\n")
- ->write('class __TwigTemplate_'.md5($this->filename))
+ ->write('class '.$compiler->getTemplateName($this->filename))
;
- $parent = null === $this->extends ? $compiler->getEnvironment()->getBaseTemplateClass() : '__TwigTemplate_'.md5($this->extends);
+ $parent = null === $this->extends ? $compiler->getEnvironment()->getBaseTemplateClass() : $compiler->getTemplateName($this->extends);
$compiler
->raw(" extends $parent\n")
$compiler
->write("\n")
- ->write('class __TwigMacro_'.md5($this->filename).' extends Twig_Macro'."\n")
+ ->write('class '.$compiler->getTemplateName($this->filename).'_Macro extends Twig_Macro'."\n")
->write("{\n")
->indent()
;