Twig \ Error \ RuntimeError
An exception has been thrown during the rendering of a template ("No menu selected").
Previous exceptions
  • No menu selected (404)
Twig\Error\RuntimeError thrown with message "An exception has been thrown during the rendering of a template ("No menu selected")." Stacktrace: #38 Twig\Error\RuntimeError in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/engines/nucleus/particles/menu.html.twig:2 #37 RuntimeException in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/src/classes/Gantry/Component/Menu/AbstractMenu.php:289 #36 Gantry\Component\Menu\AbstractMenu:instance in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:702 #35 Twig\Template:getAttribute in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #34 __TwigTemplate_d6890f14ec39bc58f2bc1e74b1072bfb7ce3f109f67e34f22271ba4465549762:doDisplay in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #33 Twig\Template:displayWithErrorHandling in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #32 Twig\Template:display in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #31 __TwigTemplate_eb9d0630fdeaa4bc1012291afddea71edb63f2d43f538b628447a431f6b3aad1:doDisplay in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #30 Twig\Template:displayWithErrorHandling in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #29 Twig\Template:display in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #28 __TwigTemplate_105c7122b3b7ee69e7f284c6f9ed05311046069e0f5f9d0d41f7c7ca3788251f:doDisplay in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #27 Twig\Template:displayWithErrorHandling in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #26 Twig\Template:display in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #25 __TwigTemplate_71661d274225592ff20fd4849c1eac1c13d1fee0a7248c419a43ccf9ab8f9b75:doDisplay in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #24 Twig\Template:displayWithErrorHandling in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #23 Twig\Template:display in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #22 __TwigTemplate_a336f9026e1a3614d364babe2321fb89bcf58318ea1273874e0c615b49410768:doDisplay in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #21 Twig\Template:displayWithErrorHandling in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #20 Twig\Template:display in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #19 __TwigTemplate_1d2c32f135765b82210a97d8ccc1f8f594b425de8424aeadafbb5cac73ef8b08:block_page_layout in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:214 #18 Twig\Template:displayBlock in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #17 __TwigTemplate_1d2c32f135765b82210a97d8ccc1f8f594b425de8424aeadafbb5cac73ef8b08:doDisplay in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #16 Twig\Template:displayWithErrorHandling in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #15 Twig\Template:display in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #14 __TwigTemplate_db68e5f279041b6057d201fe72dca78cbfd2c448b47c4fc1d11c43e147e76518:doDisplay in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #13 Twig\Template:displayWithErrorHandling in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #12 Twig\Template:display in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Environment.php:497 #11 __TwigTemplate_3c0bd08447cdedfcc4e9642921c72788a123fde1157db3500fdd1f49a8ca95b7:doDisplay in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:453 #10 Twig\Template:displayWithErrorHandling in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:420 #9 Twig\Template:display in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/Template.php:432 #8 Twig\Template:render in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/compat/vendor/twig/twig/src/TemplateWrapper.php:47 #7 Twig\TemplateWrapper:render in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/vendor/timber/timber/lib/Loader.php:79 #6 Timber\Loader:render in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:334 #5 Timber\Timber:compile in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:383 #4 Timber\Timber:fetch in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/plugins/gantry5/vendor/timber/timber/lib/Timber.php:410 #3 Timber\Timber:render in /kunden/85764_76297/sites/c.eberle/wordpress/wp-content/themes/g5_helium/404.php:32 #2 include in /kunden/85764_76297/sites/c.eberle/wordpress/wp-includes/template-loader.php:106 #1 require_once in /kunden/85764_76297/sites/c.eberle/wordpress/wp-blog-header.php:19 #0 require in /kunden/85764_76297/sites/c.eberle/wordpress/index.php:17
Stack frames (39)
38
Twig\Error\RuntimeError
/engines/nucleus/particles/menu.html.twig2
37
RuntimeException
/src/classes/Gantry/Component/Menu/AbstractMenu.php289
36
Gantry\Component\Menu\AbstractMenu instance
/compat/vendor/twig/twig/src/Template.php702
35
Twig\Template getAttribute
/compat/vendor/twig/twig/src/Environment.php497
34
__TwigTemplate_d6890f14ec39bc58f2bc1e74b1072bfb7ce3f109f67e34f22271ba4465549762 doDisplay
/compat/vendor/twig/twig/src/Template.php453
33
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
32
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
31
__TwigTemplate_eb9d0630fdeaa4bc1012291afddea71edb63f2d43f538b628447a431f6b3aad1 doDisplay
/compat/vendor/twig/twig/src/Template.php453
30
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
29
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
28
__TwigTemplate_105c7122b3b7ee69e7f284c6f9ed05311046069e0f5f9d0d41f7c7ca3788251f doDisplay
/compat/vendor/twig/twig/src/Template.php453
27
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
26
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
25
__TwigTemplate_71661d274225592ff20fd4849c1eac1c13d1fee0a7248c419a43ccf9ab8f9b75 doDisplay
/compat/vendor/twig/twig/src/Template.php453
24
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
23
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
22
__TwigTemplate_a336f9026e1a3614d364babe2321fb89bcf58318ea1273874e0c615b49410768 doDisplay
/compat/vendor/twig/twig/src/Template.php453
21
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
20
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
19
__TwigTemplate_1d2c32f135765b82210a97d8ccc1f8f594b425de8424aeadafbb5cac73ef8b08 block_page_layout
/compat/vendor/twig/twig/src/Template.php214
18
Twig\Template displayBlock
/compat/vendor/twig/twig/src/Environment.php497
17
__TwigTemplate_1d2c32f135765b82210a97d8ccc1f8f594b425de8424aeadafbb5cac73ef8b08 doDisplay
/compat/vendor/twig/twig/src/Template.php453
16
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
15
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
14
__TwigTemplate_db68e5f279041b6057d201fe72dca78cbfd2c448b47c4fc1d11c43e147e76518 doDisplay
/compat/vendor/twig/twig/src/Template.php453
13
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
12
Twig\Template display
/compat/vendor/twig/twig/src/Environment.php497
11
__TwigTemplate_3c0bd08447cdedfcc4e9642921c72788a123fde1157db3500fdd1f49a8ca95b7 doDisplay
/compat/vendor/twig/twig/src/Template.php453
10
Twig\Template displayWithErrorHandling
/compat/vendor/twig/twig/src/Template.php420
9
Twig\Template display
/compat/vendor/twig/twig/src/Template.php432
8
Twig\Template render
/compat/vendor/twig/twig/src/TemplateWrapper.php47
7
Twig\TemplateWrapper render
/vendor/timber/timber/lib/Loader.php79
6
Timber\Loader render
/vendor/timber/timber/lib/Timber.php334
5
Timber\Timber compile
/vendor/timber/timber/lib/Timber.php383
4
Timber\Timber fetch
/vendor/timber/timber/lib/Timber.php410
3
Timber\Timber render
/kunden/85764_76297/sites/c.eberle/wordpress/wp-content/themes/g5_helium/404.php32
2
include
/kunden/85764_76297/sites/c.eberle/wordpress/wp-includes/template-loader.php106
1
require_once
/kunden/85764_76297/sites/c.eberle/wordpress/wp-blog-header.php19
0
require
/kunden/85764_76297/sites/c.eberle/wordpress/index.php17
{% try %}
    {% set menu = gantry.menu.instance(particle) %}
{% catch %}
    <div class="alert alert-error">{{ e.getMessage }}</div>
{% endtry %}
 
{% macro getCustomWidth(item, menu, mode, dropdown_type, start_level) -%}
    {%- if (item.width|default('auto') != 'auto') and not (dropdown_type == 'fullwidth' and item.level > start_level) -%}
        {%- if mode == 'item' %} style="position: relative;"
        {%- elseif mode == 'submenu' %} style="width:{{ item.width }};" data-g-item-width="{{ item.width }}"
        {%- endif %}
    {%- endif %}
{%- endmacro %}
 
{% macro displayParticle(item, context) %}
    {% try %}
    {% set in_particle = (context.in_particle ?? 0) + 1 %}
    {% if in_particle > 5 %}
        {% throw 500 'Particle loop detected' %}
    {% endif %}
 
    {% set context = context|merge({ particle: item.options.particle, in_particle: in_particle}) %}
    {% set classes = item.options.block.class %}
    <div class="menu-item-particle{{ classes ? ' ' ~ classes }}">
        {% include ['particles/' ~ item.particle ~ '.html.twig', '@particles/' ~ item.particle ~ '.html.twig']
        ignore missing with context only %}
    </div>
    {% catch %}
        <div class="alert alert-error">{{ e.getMessage }}</div>
    {% endtry %}
{% endmacro %}
 
{% macro displayTitle(item) %}
    {% if not item.icon_only or not (item.image or item.icon) %}
        <span class="g-menu-item-title">{{ item.title }}</span>
        {% if item.subtitle %}
            <span class="g-menu-item-subtitle">{{ item.subtitle }}</span>
        {% endif %}
    {% endif %}
{% endmacro %}
    public function instance(array $params = [], Config $menu = null)
    {
        $params += $this->defaults;
 
        $menus = $this->getMenus();
 
        if (!$menus) {
            throw new \RuntimeException('Site does not have menus', 404);
        }
        if (empty($params['menu'])) {
            $params['menu'] = $this->getDefaultMenuName();
            if (!$params['menu'] && !empty($params['admin'])) {
                // In admin just select the first menu if there isn't default menu to be selected.
                $params['menu'] = reset($menus);
            };
        } elseif ($params['menu'] === '-active-') {
            $params['menu'] = $this->getActiveMenuName();
        }
        if (!$params['menu']) {
            throw new \RuntimeException('No menu selected', 404);
        }
        if (!\in_array($params['menu'], $menus, true)) {
            throw new \RuntimeException('Menu not found', 404);
        }
 
        $instance = clone $this;
        $instance->params = $params;
 
        if ($menu) {
            $menu->set('items', static::prepareMenuItems($menu->get('items'), $menu->get('ordering')));
            $instance->override = true;
            $instance->config = $menu;
        } else {
            $instance->config = null;
        }
 
        $config = $instance->config();
        $items = isset($config['items']) ? $config['items'] : [];
 
        // Create menu structure.
Exception message: No menu selected
            }
 
            throw new RuntimeError(sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), -1, $this->getSourceContext());
        }
 
        if ($isDefinedTest) {
            return true;
        }
 
        if ($this->env->hasExtension('\Twig\Extension\SandboxExtension')) {
            $this->env->getExtension('\Twig\Extension\SandboxExtension')->checkMethodAllowed($object, $method);
        }
 
        // Some objects throw exceptions when they have __call, and the method we try
        // to call is not supported. If ignoreStrictCheck is true, we should return null.
        try {
            if (!$arguments) {
                $ret = $object->$method();
            } else {
                $ret = \call_user_func_array([$object, $method], $arguments);
            }
        } catch (\BadMethodCallException $e) {
            if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) {
                return;
            }
            throw $e;
        }
 
        // @deprecated in 1.28
        if ($object instanceof \Twig_TemplateInterface) {
            $self = $object->getTemplateName() === $this->getTemplateName();
            $message = sprintf('Calling "%s" on template "%s" from template "%s" is deprecated since version 1.28 and won\'t be supported anymore in 2.0.', $item, $object->getTemplateName(), $this->getTemplateName());
            if ('renderBlock' === $method || 'displayBlock' === $method) {
                $message .= sprintf(' Use block("%s"%s) instead).', $arguments[0], $self ? '' : ', template');
            } elseif ('hasBlock' === $method) {
                $message .= sprintf(' Use "block("%s"%s) is defined" instead).', $arguments[0], $self ? '' : ', template');
            } elseif ('render' === $method || 'display' === $method) {
                $message .= sprintf(' Use include("%s") instead).', $object->getTemplateName());
            }
            @trigger_error($message, \E_USER_DEPRECATED);
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
 
        if ($useBlocks && isset($blocks[$name])) {
            $template = $blocks[$name][0];
            $block = $blocks[$name][1];
        } elseif (isset($this->blocks[$name])) {
            $template = $this->blocks[$name][0];
            $block = $this->blocks[$name][1];
        } else {
            $template = null;
            $block = null;
        }
 
        // avoid RCEs when sandbox is enabled
        if (null !== $template && !$template instanceof self) {
            throw new \LogicException('A block must be a method on a \Twig\Template instance.');
        }
 
        if (null !== $template) {
            try {
                $template->$block($context, $blocks);
            } catch (Error $e) {
                if (!$e->getSourceContext()) {
                    $e->setSourceContext($template->getSourceContext());
                }
 
                // this is mostly useful for \Twig\Error\LoaderError exceptions
                // see \Twig\Error\LoaderError
                if (-1 === $e->getTemplateLine()) {
                    $e->guess();
                }
 
                throw $e;
            } catch (\Exception $e) {
                $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e);
                $e->guess();
 
                throw $e;
            }
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false);
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                } else {
                    $source = $loader->getSourceContext($name);
                }
 
                $content = $this->compileSource($source);
 
                if ($this->bcWriteCacheFile) {
                    $this->writeCacheFile($key, $content);
                } else {
                    $this->cache->write($key, $content);
                    $this->cache->load($key);
                }
 
                if (!class_exists($mainCls, false)) {
                    /* Last line of defense if either $this->bcWriteCacheFile was used,
                     * $this->cache is implemented as a no-op or we have a race condition
                     * where the cache was cleared between the above calls to write to and load from
                     * the cache.
                     */
                    eval('?>'.$content);
                }
            }
 
            if (!class_exists($cls, false)) {
                throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
            }
        }
 
        if (!$this->runtimeInitialized) {
            $this->initRuntime();
        }
 
        return $this->loadedTemplates[$cls] = new $cls($this);
    }
 
    /**
     * Creates a template from source.
     *
     * This method should not be used as a generic way to load templates.
     *
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
     * @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
     *
     * @return string The rendered template
     */
    public function render($context = [])
    {
        // 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_num_args() > 1 ? func_get_arg(1) : []);
    }
 
    /**
     * Displays the template.
     *
     * @param array $context An array of parameters to pass to the template
     */
    public function display($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_num_args() > 1 ? func_get_arg(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
     *
 
        $key = null;
        $output = false;
        if ( false !== $expires ) {
            ksort($data);
            $key = md5($file.json_encode($data));
            $output = $this->get_cache($key, self::CACHEGROUP, $cache_mode);
        }
 
        if ( false === $output || null === $output ) {
            $twig = $this->get_twig();
            if ( strlen($file) ) {
                $loader = $this->get_loader();
                $result = $loader->getCacheKey($file);
                do_action('timber_loader_render_file', $result);
            }
            $data = apply_filters('timber_loader_render_data', $data);
            $data = apply_filters('timber/loader/render_data', $data, $file);
            $template = $twig->load($file);
            $output = $template->render($data);
        }
 
        if ( false !== $output && false !== $expires && null !== $key ) {
            $this->delete_cache();
            $this->set_cache($key, $output, self::CACHEGROUP, $expires, $cache_mode);
        }
        $output = apply_filters('timber_output', $output);
        return apply_filters('timber/output', $output, $data, $file);
    }
 
    protected function delete_cache() {
        Cleaner::delete_transients();
    }
 
    /**
     * Get first existing template.
     *
     * @param array|string $templates  Name(s) of the Twig template(s) to choose from.
     * @return string|bool             Name of chosen template, otherwise false.
     */
        if ( $via_render ) {
            $file = apply_filters('timber_render_file', $file);
        } else {
            $file = apply_filters('timber_compile_file', $file);
        }
 
        $output = false;
 
        if ($file !== false) {
            if ( is_null($data) ) {
                $data = array();
            }
 
            if ( $via_render ) {
                $data = apply_filters('timber_render_data', $data);
            } else {
                $data = apply_filters('timber_compile_data', $data);
            }
 
            $output = $loader->render($file, $data, $expires, $cache_mode);
        } else {
            if ( is_array($filenames) ) {
                $filenames = implode(", ", $filenames);
            }
            Helper::error_log( 'Error loading your template files: '.$filenames.'. Make sure one of these files exists.' );
        }
 
        do_action('timber_compile_done');
        return $output;
    }
 
    /**
     * Compile a string.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'username' => 'Jane Doe',
     * );
        $twig = $dummy_loader->get_twig();
        $template = $twig->createTemplate($string);
        return $template->render($data);
    }
 
    /**
     * Fetch function.
     *
     * @api
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     *                                 array, the first value is used for non-logged in visitors, the second for users.
     *                                 Default false.
     * @param string       $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
     * @return bool|string The returned output.
     */
    public static function fetch( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
        $output = self::compile($filenames, $data, $expires, $cache_mode, true);
        $output = apply_filters('timber_compile_result', $output);
        return $output;
    }
 
    /**
     * Render function.
     *
     * Passes data to a Twig file and echoes the output.
     *
     * @api
     * @example
     * ```php
     * $context = Timber::context();
     *
     * Timber::render( 'index.twig', $context );
     * ```
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     * Passes data to a Twig file and echoes the output.
     *
     * @api
     * @example
     * ```php
     * $context = Timber::context();
     *
     * Timber::render( 'index.twig', $context );
     * ```
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     *                                 array, the first value is used for non-logged in visitors, the second for users.
     *                                 Default false.
     * @param string       $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
     * @return bool|string The echoed output.
     */
    public static function render( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
        $output = self::fetch($filenames, $data, $expires, $cache_mode);
        echo $output;
        return $output;
    }
 
    /**
     * Render a string with Twig variables.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'username' => 'Jane Doe',
     * );
     *
     * Timber::render_string( 'Hi {{ username }}, I’m a string with a custom Twig variable', $data );
     * ```
     * @param string $string A string with Twig variables.
     * @param array  $data   An array of data to use in Twig template.
     * @return bool|string
     */
 
use Gantry\Framework\Gantry;
use Gantry\Framework\Theme;
use Timber\Timber;
 
/*
 * The template for displaying 404 pages (Not Found)
 */
 
$gantry = Gantry::instance();
 
/** @var Theme $theme */
$theme  = $gantry['theme'];
$theme->setLayout('_error', true);
 
// We need to render contents of <head> before plugin content gets added.
$context              = Timber::get_context();
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
 
Timber::render('404.html.twig', $context);
 
            }
 
            break;
        }
    }
 
    if ( ! $template ) {
        $template = get_index_template();
    }
 
    /**
     * Filters the path of the current template before including it.
     *
     * @since 3.0.0
     *
     * @param string $template The path of the template to include.
     */
    $template = apply_filters( 'template_include', $template );
    if ( $template ) {
        include $template;
    } elseif ( current_user_can( 'switch_themes' ) ) {
        $theme = wp_get_theme();
        if ( $theme->errors() ) {
            wp_die( $theme->errors() );
        }
    }
    return;
}
 
<?php
/**
 * Loads the WordPress environment and template.
 *
 * @package WordPress
 */
 
if ( ! isset( $wp_did_header ) ) {
 
    $wp_did_header = true;
 
    // Load the WordPress library.
    require_once __DIR__ . '/wp-load.php';
 
    // Set up the WordPress query.
    wp();
 
    // Load the theme template.
    require_once ABSPATH . WPINC . '/template-loader.php';
 
}
 
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */
 
/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define( 'WP_USE_THEMES', true );
 
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
 

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE Apache
REQUEST_URI /component/tags/tag/brechtsee
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
TEMP /temp/85764/re631644/clairweb.de
TMPDIR /temp/85764/re631644/clairweb.de
USER re631644
HOME /kunden/85764_76297/sites/c.eberle
SCRIPT_NAME /index.php
QUERY_STRING
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/1.1
GATEWAY_INTERFACE CGI/1.1
REDIRECT_URL /component/tags/tag/brechtsee
REMOTE_PORT 60110
SCRIPT_FILENAME /kunden/85764_76297/sites/c.eberle/wordpress/index.php
SERVER_ADMIN webmaster@www.clairweb.de
CONTEXT_DOCUMENT_ROOT /kunden/85764_76297/sites/c.eberle/wordpress
CONTEXT_PREFIX
REQUEST_SCHEME http
DOCUMENT_ROOT /kunden/85764_76297/sites/c.eberle/wordpress
REMOTE_ADDR 44.222.149.13
SERVER_PORT 80
SERVER_ADDR 172.27.0.11
SERVER_NAME www.clairweb.de
SERVER_SIGNATURE
HTTP_REFERER http://www.clairweb.de/index.php/component/tags/tag/brechtsee
HTTP_USER_AGENT claudebot
HTTP_ACCEPT */*
HTTP_CONNECTION close
HTTP_RANGE bytes=0-5242879
HTTP_X_FORWARDED_FROM 44.222.149.13
HTTP_X_FORWARDED_PROTO http
HTTP_HOST www.clairweb.de
proxy-nokeepalive 1
HTTP_AUTHORIZATION
PHPEdition 7-4
DFSERVER_ALIAS clairweb.de
DFLIMITPROC 0
DFLIMITCPU 40
DFLIMITMEM 256000
DFCANCGI 1
PHPVersion 7-4-FCGI
DFCATCHALLSTATUS FALSE
DFDNUMBER 22156
DFUID 99999
UNIQUE_ID ZfkqdMnE0_xI_hb-OFVPzAAAABs
REDIRECT_STATUS 200
REDIRECT_HTTP_AUTHORIZATION
REDIRECT_PHPEdition 7-4
REDIRECT_DFSERVER_ALIAS clairweb.de
REDIRECT_DFLIMITPROC 0
REDIRECT_DFLIMITCPU 40
REDIRECT_DFLIMITMEM 256000
REDIRECT_DFCANCGI 1
REDIRECT_PHPVersion 7-4-FCGI
REDIRECT_DFCATCHALLSTATUS FALSE
REDIRECT_DFDNUMBER 22156
REDIRECT_DFUID 99999
REDIRECT_UNIQUE_ID ZfkqdMnE0_xI_hb-OFVPzAAAABs
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1710828148.3804
REQUEST_TIME 1710828148
empty
0. Whoops\Handler\PrettyPageHandler