From the change log on # 3.0.0-BETA1 (2019-11-11)
- removed the "base_template_class" option on Twig\Environment
I have a custom Template class extend from Twig\Template
which override the display()
and render()
function
public function display(array $context, array $blocks = null)
{
$env = $this->env;
$env->addTemplateStack($this->getTemplateName());
if (is_array($blocks))
{
$env->current_inheritance_level++;
$this->inheritance_level = $env->current_inheritance_level;
$env->active_inheritance_level = $env->current_inheritance_level;
parent::display($context, $blocks);
}
else {
// Call to the deepest template or include
parent::display($context, []);
}
}
public function render(array $context)
{
$env = $this->env;
$this->inheritance_level = 0;
$env->active_inheritance_level = 0;
$env->current_inheritance_level = 0;
return parent::render($context);
}
But with Twig V3 base_template_class
option was removed
So I have to use the original display & render function instead.
What is the alternative to having these kinds of data on V3