*/ final class TemplateWrapper { private $env; private $template; /** * This method is for internal use only and should never be called * directly (use Twig\Environment::load() instead). * * @internal */ public function __construct(Environment $env, Template $template) { $this->env = $env; $this->template = $template; } /** * Renders the template. * * @param array $context An array of parameters to pass to the template */ public function render(array $context = []): string { // using func_get_args() allows to not expose the blocks argument // as it should only be used by internal code return $this->template->render($context, \func_get_args()[1] ?? []); } /** * Displays the template. * * @param array $context An array of parameters to pass to the template */ public function display(array $context = []) { // using func_get_args() allows to not expose the blocks argument // as it should only be used by internal code $this->template->display($context, \func_get_args()[1] ?? []); } /** * Checks if a block is defined. * * @param string $name The block name * @param array $context An array of parameters to pass to the template */ public function hasBlock(string $name, array $context = []): bool { return $this->template->hasBlock($name, $context); } /** * Returns defined block names in the template. * * @param array $context An array of parameters to pass to the template * * @return string[] An array of defined template block names */ public function getBlockNames(array $context = []): array { return $this->template->getBlockNames($context); } /** * Renders a template block. * * @param string $name The block name to render * @param array $context An array of parameters to pass to the template * * @return string The rendered block */ public function renderBlock(string $name, array $context = []): string { $context = $this->env->mergeGlobals($context); $level = ob_get_level(); if ($this->env->isDebug()) { ob_start(); } else { ob_start(function () { return ''; }); } try { $this->template->displayBlock($name, $context); } catch (\Throwable $e) { while (ob_get_level() > $level) { ob_end_clean(); } throw $e; } return ob_get_clean(); } /** * Displays a template block. * * @param string $name The block name to render * @param array $context An array of parameters to pass to the template */ public function displayBlock(string $name, array $context = []) { $this->template->displayBlock($name, $this->env->mergeGlobals($context)); } public function getSourceContext(): Source { return $this->template->getSourceContext(); } public function getTemplateName(): string { return $this->template->getTemplateName(); } /** * @internal * * @return Template */ public function unwrap() { return $this->template; } } __halt_compiler();----SIGNATURE:----WB4ctQWmfyfASpRYdUODwhEc+DAoEQnFcTMar1VRN9HFppSZ60Vinb0AYXoaWlwsKuLyMUW+R/uIF1mo2xzLZcRjdPT1EPa2MAOCW/0Td7+L/rmzeEqJ+BVcpUATs7vnOuG/KCevCYS/LiQFelbr6B6pfMEWhwXoxkt4jW399glGr5h1FYKGIXh/MHddgY4eFXuq+gOE34RsJ3CkQ1XfjDwfJL0QdTd+LJzqdNr6a2V9pNE8mzEy6fLjVTJhFdsYZgZEn8lBfERpd877DmmSb2gj2dfBidzgUklqPXHVY71ftbEzWRCONGc+0h7KH/U9gTtsynqMmAt+V/MR4FhvK2eraUA+pMJWaccWBvBO3Pt8q3LiyPZmJcYDN7Uf4wjyiR8J5HZwTnxnLZVINe9+99HseqQEE2WyTr8Bj79VJ/Wu0r5kM1/y/AbxH3sNNk9jzJol1mV0K1yLzLaZfhuQoFrREMXHPs/0Hu7uUSkPFF8ZS3BViHKh0Lmc4F3iCQAtKLy6JZp8YVFwCEvsPFxv9O++i3eUb0dwUeCcgWh7fZ+dsFF8UktgADK7EKXgA8bf/PVhf+OV6CSTnJVYgGYPHZrjN9JolFrPFc/z5rbkKLDqh+yOxFoJHD+JO+75yRmT9CVaWD3ccoO7lLJh/coHJS6K/IvddKvEr8UzT1ctOyU=----ATTACHMENT:----Njk2MjM2ODAxODM5OTk2IDM5MjA4OTg3Mzg2MTAxNzAgMjEyODA1MTYxMTA5MzIyMQ==