Resolve constant parent templates once instead of on every lookup

This commit is contained in:
Fabien Potencier
2026-09-11 06:10:11 -07:00
parent 4de6bc3b06
commit c53b6468c9
4 changed files with 25 additions and 10 deletions
+1 -1
View File
@@ -232,7 +232,7 @@ class __TwigTemplate_%x extends Template
protected function doGetParent(array \$context): bool|string|Template|TemplateWrapper
{
// line 1
return "layout.twig";
return \$this->parent ??= \$this->load("layout.twig", 1);
}
protected function doDisplay(array \$context, array \$blocks = []): iterable