Twig \ Error \ RuntimeError
An exception has been thrown during the rendering of a template ("Undefined property: App\Models\FxbNewsPost::$country").
Previous exceptions
  • Undefined property: App\Models\FxbNewsPost::$country (2)
Twig\Error\RuntimeError thrown with message "An exception has been thrown during the rendering of a template ("Undefined property: App\Models\FxbNewsPost::$country")." Stacktrace: #24 Twig\Error\RuntimeError in /var/www/fxb-site/src/views/components/hero/hero-single-fxb-news.twig:11 #23 Whoops\Exception\ErrorException in /var/www/fxb-site/App/Models/FxbNewsPost.php:82 #22 Timber\Post:__get in /var/www/fxb-site/App/Models/FxbNewsPost.php:82 #21 App\Models\FxbNewsPost:country in /var/www/fxb-site/vendor/twig/twig/src/Extension/CoreExtension.php:1570 #20 twig_get_attribute in /var/www/fxb-site/vendor/twig/twig/src/Environment.php:418 #19 __TwigTemplate_d4a7651b1fc1699fd0691b74a9d7f563d360eace27a910d886ab6c6e3e71ef15:doDisplay in /var/www/fxb-site/vendor/twig/twig/src/Template.php:405 #18 Twig\Template:displayWithErrorHandling in /var/www/fxb-site/vendor/twig/twig/src/Template.php:378 #17 Twig\Template:display in /var/www/fxb-site/vendor/twig/twig/src/Environment.php:418 #16 __TwigTemplate_5d13cd2cf0ef496e209632134d59a3afd6c60c4e684ce5b5f7c4adcb859c2248:block_content in /var/www/fxb-site/vendor/twig/twig/src/Template.php:182 #15 Twig\Template:displayBlock in /var/www/fxb-site/vendor/twig/twig/src/Environment.php:418 #14 __TwigTemplate_f4f33fe1fbb0fc8ce33930ae49ae86bc17d34b78c134fff83932a5dfda9e4369:doDisplay in /var/www/fxb-site/vendor/twig/twig/src/Template.php:405 #13 Twig\Template:displayWithErrorHandling in /var/www/fxb-site/vendor/twig/twig/src/Template.php:378 #12 Twig\Template:display in /var/www/fxb-site/vendor/twig/twig/src/Environment.php:418 #11 __TwigTemplate_5d13cd2cf0ef496e209632134d59a3afd6c60c4e684ce5b5f7c4adcb859c2248:doDisplay in /var/www/fxb-site/vendor/twig/twig/src/Template.php:405 #10 Twig\Template:displayWithErrorHandling in /var/www/fxb-site/vendor/twig/twig/src/Template.php:378 #9 Twig\Template:display in /var/www/fxb-site/vendor/twig/twig/src/Template.php:390 #8 Twig\Template:render in /var/www/fxb-site/vendor/twig/twig/src/TemplateWrapper.php:45 #7 Twig\TemplateWrapper:render in /var/www/fxb-site/vendor/timber/timber/lib/Loader.php:79 #6 Timber\Loader:render in /var/www/fxb-site/vendor/timber/timber/lib/Timber.php:334 #5 Timber\Timber:compile in /var/www/fxb-site/vendor/timber/timber/lib/Timber.php:383 #4 Timber\Timber:fetch in /var/www/fxb-site/vendor/timber/timber/lib/Timber.php:410 #3 Timber\Timber:render in /var/www/fxb-site/web/app/themes/fxb/single-fxb-news.php:20 #2 include in /var/www/fxb-site/web/wp/wp-includes/template-loader.php:106 #1 require_once in /var/www/fxb-site/web/wp/wp-blog-header.php:19 #0 require in /var/www/fxb-site/web/index.php:6
Stack frames (25)
24
Twig\Error\RuntimeError
/src/views/components/hero/hero-single-fxb-news.twig11
23
Whoops\Exception\ErrorException
/App/Models/FxbNewsPost.php82
22
Timber\Post __get
/App/Models/FxbNewsPost.php82
21
App\Models\FxbNewsPost country
/vendor/twig/twig/src/Extension/CoreExtension.php1570
20
twig_get_attribute
/vendor/twig/twig/src/Environment.php418
19
__TwigTemplate_d4a7651b1fc1699fd0691b74a9d7f563d360eace27a910d886ab6c6e3e71ef15 doDisplay
/vendor/twig/twig/src/Template.php405
18
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
17
Twig\Template display
/vendor/twig/twig/src/Environment.php418
16
__TwigTemplate_5d13cd2cf0ef496e209632134d59a3afd6c60c4e684ce5b5f7c4adcb859c2248 block_content
/vendor/twig/twig/src/Template.php182
15
Twig\Template displayBlock
/vendor/twig/twig/src/Environment.php418
14
__TwigTemplate_f4f33fe1fbb0fc8ce33930ae49ae86bc17d34b78c134fff83932a5dfda9e4369 doDisplay
/vendor/twig/twig/src/Template.php405
13
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
12
Twig\Template display
/vendor/twig/twig/src/Environment.php418
11
__TwigTemplate_5d13cd2cf0ef496e209632134d59a3afd6c60c4e684ce5b5f7c4adcb859c2248 doDisplay
/vendor/twig/twig/src/Template.php405
10
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php378
9
Twig\Template display
/vendor/twig/twig/src/Template.php390
8
Twig\Template render
/vendor/twig/twig/src/TemplateWrapper.php45
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
/web/app/themes/fxb/single-fxb-news.php20
2
include
/web/wp/wp-includes/template-loader.php106
1
require_once
/web/wp/wp-blog-header.php19
0
require
/web/index.php6
/var/www/fxb-site/src/views/components/hero/hero-single-fxb-news.twig
{# <?php #}
<div class="hero  __single-news __orange-light" style="background-image: url({{ post.hero_background.sizes.hero }})">
 
   <div class="container">
 
      {% include "components/breadcrumb/breadcrumb.twig" %}
 
      <div class="hero__content">
         <h1 class="hero__title"><span>{{ post.title}} </span></h1>
         <div class="hero__tags">
            <a href="{{ post.country.link }}" class="tag __gray">{{ post.country.title }}</a>
            <a href="{{ post.category.link }}" class="tag " style="background-color: {{post.tag_color}}">{{ post.category }}</a>
         </div>
         <div class="hero__publish-date">
            <span class="tag __gray __sm"> {{ __('Posted on', 'fxb') }} {{ post.date}} </span>
         </div>
      </div>
 
   </div>
 
   <div class="hero__details-context">
      <div class="container">
         <div class="hero__details-context__content">{{post.meta('hero_context')}}</div>
      </div>
   </div>
</div>
 
Arguments
  1. "An exception has been thrown during the rendering of a template ("Undefined property: App\Models\FxbNewsPost::$country")."
    
/var/www/fxb-site/App/Models/FxbNewsPost.php
            return 'bg-blue-green';
         } elseif ($cat->slug == "nutrition" or $cat->slug == "nutrition-fr") {
            return 'bg-blue-second';
         }
      }
   }
 
 
   public function hero_background()
   {
      if (!$this->_hero_background || is_string($this->_hero_background)) {
         $this->_hero_background =  get_field('hero_background', $this->ID);
      }
      return $this->_hero_background;
   }
 
   public function country()
   {
      if (!$this->_country || is_string($this->_country)) {
         $this->_country =  new CountryPost($this->country);
      }
      return $this->_country;
   }
 
   public function title()
   {
      if (!$this->_title || is_string($this->_title)) {
         $this->_title =  $this->post_title;
      }
      return $this->_title;
   }
 
   public function post_same_category()
   {
 
      if (!$this->_post_same_category && !$this->_post_same_category instanceof \App\Models\FxbNewsPost) {
 
         $args = array(
            'post_type' => 'fxb-news',
            'orderby' => 'rand',
Arguments
  1. "Undefined property: App\Models\FxbNewsPost::$country"
    
Exception message: Undefined property: App\Models\FxbNewsPost::$country
/var/www/fxb-site/App/Models/FxbNewsPost.php
            return 'bg-blue-green';
         } elseif ($cat->slug == "nutrition" or $cat->slug == "nutrition-fr") {
            return 'bg-blue-second';
         }
      }
   }
 
 
   public function hero_background()
   {
      if (!$this->_hero_background || is_string($this->_hero_background)) {
         $this->_hero_background =  get_field('hero_background', $this->ID);
      }
      return $this->_hero_background;
   }
 
   public function country()
   {
      if (!$this->_country || is_string($this->_country)) {
         $this->_country =  new CountryPost($this->country);
      }
      return $this->_country;
   }
 
   public function title()
   {
      if (!$this->_title || is_string($this->_title)) {
         $this->_title =  $this->post_title;
      }
      return $this->_title;
   }
 
   public function post_same_category()
   {
 
      if (!$this->_post_same_category && !$this->_post_same_category instanceof \App\Models\FxbNewsPost) {
 
         $args = array(
            'post_type' => 'fxb-news',
            'orderby' => 'rand',
/var/www/fxb-site/vendor/twig/twig/src/Extension/CoreExtension.php
 
        if ($ignoreStrictCheck || !$env->isStrictVariables()) {
            return;
        }
 
        throw new RuntimeError(sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()"/"has%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), $lineno, $source);
    }
 
    if ($isDefinedTest) {
        return true;
    }
 
    if ($sandboxed) {
        $env->getExtension(SandboxExtension::class)->checkMethodAllowed($object, $method, $lineno, $source);
    }
 
    // 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 {
        $ret = $object->$method(...$arguments);
    } catch (\BadMethodCallException $e) {
        if ($call && ($ignoreStrictCheck || !$env->isStrictVariables())) {
            return;
        }
        throw $e;
    }
 
    return $ret;
}
 
/**
 * Returns the values from a single column in the input array.
 *
 * <pre>
 *  {% set items = [{ 'fruit' : 'apple'}, {'fruit' : 'orange' }] %}
 *
 *  {% set fruits = items|column('fruit') %}
 *
 *  {# fruits now contains ['apple', 'orange'] #}
 * </pre>
/var/www/fxb-site/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $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);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        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.
     *
     * @param string $template The template source
/var/www/fxb-site/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } 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;
        }
    }
 
/var/www/fxb-site/vendor/twig/twig/src/Template.php
    {
        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 (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/fxb-site/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $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);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        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.
     *
     * @param string $template The template source
/var/www/fxb-site/vendor/twig/twig/src/Template.php
    {
        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, $templateContext ?? $this);
/var/www/fxb-site/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $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);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        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.
     *
     * @param string $template The template source
/var/www/fxb-site/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } 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;
        }
    }
 
/var/www/fxb-site/vendor/twig/twig/src/Template.php
    {
        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 (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/fxb-site/vendor/twig/twig/src/Environment.php
            $key = $this->cache->generateKey($name, $mainCls);
 
            if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
                $this->cache->load($key);
            }
 
            $source = null;
            if (!class_exists($cls, false)) {
                $source = $this->getLoader()->getSourceContext($name);
                $content = $this->compileSource($source);
                $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);
                }
            }
        }
 
        // to be removed in 3.0
        $this->extensionSet->initRuntime($this);
 
        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.
     *
     * @param string $template The template source
/var/www/fxb-site/vendor/twig/twig/src/Template.php
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } 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;
        }
    }
 
/var/www/fxb-site/vendor/twig/twig/src/Template.php
    {
        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 (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
/var/www/fxb-site/vendor/twig/twig/src/Template.php
    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 (\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());
            }
 
/var/www/fxb-site/vendor/twig/twig/src/TemplateWrapper.php
     * 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
     */
/var/www/fxb-site/vendor/timber/timber/lib/Loader.php
 
        $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.
     */
/var/www/fxb-site/vendor/timber/timber/lib/Timber.php
        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',
     * );
/var/www/fxb-site/vendor/timber/timber/lib/Timber.php
        $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
/var/www/fxb-site/vendor/timber/timber/lib/Timber.php
     * 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
     */
/var/www/fxb-site/web/app/themes/fxb/single-fxb-news.php
<?php
 
use Timber\Timber;
use App\Models\FxbNewsPost;
use App\Modules\ModuleLoader;
 
$context = Timber::context();
$context['post'] = new FxbNewsPost();
// dd($context['post']->modules_footer);
// End load erms data
$aboutus = new ModuleLoader("about-us");
$context['post']->modules_footer =  [
   [
      "slug" => "about-us",
      "acf_data" => $aboutus->acf_data,
      "module_data" => $aboutus->module_data,
   ]
];
 
Timber::render(['templates/single-fxb-news.twig', 'single.twig'],  $context );
 
/var/www/fxb-site/web/wp/wp-includes/template-loader.php
            }
 
            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;
}
 
Arguments
  1. "/var/www/fxb-site/web/app/themes/fxb/single-fxb-news.php"
    
/var/www/fxb-site/web/wp/wp-blog-header.php
<?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';
 
}
 
Arguments
  1. "/var/www/fxb-site/web/wp/wp-includes/template-loader.php"
    
/var/www/fxb-site/web/index.php
<?php
 
 
/** WordPress view bootstrapper */
define('WP_USE_THEMES', true);
require __DIR__ . '/wp/wp-blog-header.php';
 
Arguments
  1. "/var/www/fxb-site/web/wp/wp-blog-header.php"
    

Environment & details:

empty
empty
empty
Key Value
wp-wpml_current_language
"fr"
empty
Key Value
SERVER_SOFTWARE
"Apache/2.4.41 (Ubuntu)"
REQUEST_URI
"/fr/fxb-news/global-2/les-orphelins-de-la-pandemie-de-la-covid-19/"
REDIRECT_W3TC_QUERY_STRING
""
REDIRECT_W3TC_SSL
"_ssl"
REDIRECT_W3TC_SLASH
"_slash"
REDIRECT_HTTP_AUTHORIZATION
""
REDIRECT_HTTPS
"on"
REDIRECT_SSL_TLS_SNI
"fxb.org"
REDIRECT_STATUS
"200"
W3TC_QUERY_STRING
""
W3TC_SSL
"_ssl"
HTTP_AUTHORIZATION
""
HTTPS
"on"
SSL_TLS_SNI
"fxb.org"
HTTP_ACCEPT
"*/*"
HTTP_USER_AGENT
"claudebot"
HTTP_HOST
"fxb.org"
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
SERVER_SIGNATURE
""
SERVER_NAME
"fxb.org"
SERVER_ADDR
"64.225.98.200"
SERVER_PORT
"443"
REMOTE_ADDR
"44.201.131.213"
DOCUMENT_ROOT
"/var/www/fxb-site/web"
REQUEST_SCHEME
"https"
CONTEXT_PREFIX
""
CONTEXT_DOCUMENT_ROOT
"/var/www/fxb-site/web"
SERVER_ADMIN
"webmaster@localhost"
SCRIPT_FILENAME
"/var/www/fxb-site/web/index.php"
REMOTE_PORT
"40648"
REDIRECT_URL
"/fr/fxb-news/global-2/les-orphelins-de-la-pandemie-de-la-covid-19/"
GATEWAY_INTERFACE
"CGI/1.1"
SERVER_PROTOCOL
"HTTP/1.1"
REQUEST_METHOD
"GET"
QUERY_STRING
""
SCRIPT_NAME
"/index.php"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1711669641.9794
REQUEST_TIME
1711669641
DB_NAME
"fxb-prod"
DB_USER
"wordpress"
DB_PASSWORD
"69b32805ff8d63435218bce2774f684d16b67bfcd9c1af9c"
DB_HOST
"localhost"
DB_PREFIX
"fxb_"
THEME_NAME
"fxb"
WP_ENV
"development"
WP_HOME
"https://fxb.org"
WP_SITEURL
"https://fxb.org/wp"
AUTH_KEY
"cvlbD3K<C+ez#&fNLH@T7(_Ory7^84h^GLL(;z]SJ,n#Hm5?t9j`XZN2xqtCjbY."
SECURE_AUTH_KEY
"w>aGG#Kn6m||HbL-90bGer/{RcO6k,Q?klmNR;?#%j9#JxZ/<Lb$*oU[/[z5UFKN"
LOGGED_IN_KEY
"2EWq-4_=$Dj3r3wcn5V9H;p0LC.a7g3;#.CT;)zeqRZBg+btlmPX/<=Eq.*]Zkc@"
NONCE_KEY
"us-Iu=kLHZd2vw`NzU<mV==po9+#zTXaM<NCB,]/->-n8%VFOfDC*r.w4w5WXY/r"
AUTH_SALT
"ca,YKD}AYtC$V]ngmh&sN@KCD0fy-]HGd]{*AFMWL6*i@>mAb}z]|k}34*$onX*^"
SECURE_AUTH_SALT
"9s>ZIKQuZeFhVcxna?O&bp%2dCRY<{yLA5?NYpX`z]V*<|k(q7WL_6k_2_4T^X`p"
LOGGED_IN_SALT
"`YEw}%FQ`dv+nLI1wsX+N5X:EFxIIF]I:oIUc=kG?!Rp4y*:#*Ne)Xv0/Sqxrm|H"
NONCE_SALT
"de&B(yNHrZxS)Y-|:^xHdr%CoRRfR<vkK*88!kLoJzTx*Fg{@1$!/<<R6w;YV5pQ"
FB_SECRET_KEY
"2b8a423ac74f9745bdd07cbf5a529779"
FB_APP_ID
"2285930051712632"
FB_APP_TOKEN
"649502372278822|7uKpche7trbTC-YnZ9cMZYFCW2A"
FB_PAGE_ID
"121187491240980"
FB_ACCESS_TOKEN
"EAAgfCpC2tngBANISIZChnklxaqbAzX4728wKLb9nDZCAZCGFwqlLZC9jXbT3FxZBYwWGgqA2p6dtqKT8M3khmCbQOZCocygrKPt0wJnme6EOQsbaGBydZB3EjYizwGashYualEZBphUAoeZAIblmTnp7eJfeYb0uBdf4xGC1VZBGw6EwZDZD"
TWITTER_CONSUMER_ID
"xF7Mg83uy0ymt1cyvapKXE6sF"
TWITTER_CONSUMER_SECRET
"LRq6F6NROMVnECTKTXE7t8GahQwY5vyMUXxD5cv06yKxWATwYC"
TWITTER_ACCESS_TOKEN
"82350437-QroF9BX3ONUfhzDICq81wX2Ul76e8ALOtZL6KPgP9"
TWITTER_ACCESS_TOKEN_SECRET
"dLtBVOJMrgDIiCvrjTieaqVlbUQAqzaOpie8sxLqxE8PL"
INSTAGRAM_ACCESS_TOKEN
"IGQVJXQ3hSV3lXNEtNV2JkUFdpclpqSkR6ZA2JTWFlSUzctbG9PdjFYaDJ1dGNNVTRCV3BfYjJsejg2SHd5SVIwblc3ZAkVxS29hSWg0eDZAJY0xBeXA5bEhDeG9BcC14MnJaemZAaTG14QTkxaTJUZAkpHRgZDZD"
Key Value
DB_NAME
"fxb-prod"
DB_USER
"wordpress"
DB_PASSWORD
"69b32805ff8d63435218bce2774f684d16b67bfcd9c1af9c"
DB_HOST
"localhost"
DB_PREFIX
"fxb_"
THEME_NAME
"fxb"
WP_ENV
"development"
WP_HOME
"https://fxb.org"
WP_SITEURL
"https://fxb.org/wp"
AUTH_KEY
"cvlbD3K<C+ez#&fNLH@T7(_Ory7^84h^GLL(;z]SJ,n#Hm5?t9j`XZN2xqtCjbY."
SECURE_AUTH_KEY
"w>aGG#Kn6m||HbL-90bGer/{RcO6k,Q?klmNR;?#%j9#JxZ/<Lb$*oU[/[z5UFKN"
LOGGED_IN_KEY
"2EWq-4_=$Dj3r3wcn5V9H;p0LC.a7g3;#.CT;)zeqRZBg+btlmPX/<=Eq.*]Zkc@"
NONCE_KEY
"us-Iu=kLHZd2vw`NzU<mV==po9+#zTXaM<NCB,]/->-n8%VFOfDC*r.w4w5WXY/r"
AUTH_SALT
"ca,YKD}AYtC$V]ngmh&sN@KCD0fy-]HGd]{*AFMWL6*i@>mAb}z]|k}34*$onX*^"
SECURE_AUTH_SALT
"9s>ZIKQuZeFhVcxna?O&bp%2dCRY<{yLA5?NYpX`z]V*<|k(q7WL_6k_2_4T^X`p"
LOGGED_IN_SALT
"`YEw}%FQ`dv+nLI1wsX+N5X:EFxIIF]I:oIUc=kG?!Rp4y*:#*Ne)Xv0/Sqxrm|H"
NONCE_SALT
"de&B(yNHrZxS)Y-|:^xHdr%CoRRfR<vkK*88!kLoJzTx*Fg{@1$!/<<R6w;YV5pQ"
FB_SECRET_KEY
"2b8a423ac74f9745bdd07cbf5a529779"
FB_APP_ID
"2285930051712632"
FB_APP_TOKEN
"649502372278822|7uKpche7trbTC-YnZ9cMZYFCW2A"
FB_PAGE_ID
"121187491240980"
FB_ACCESS_TOKEN
"EAAgfCpC2tngBANISIZChnklxaqbAzX4728wKLb9nDZCAZCGFwqlLZC9jXbT3FxZBYwWGgqA2p6dtqKT8M3khmCbQOZCocygrKPt0wJnme6EOQsbaGBydZB3EjYizwGashYualEZBphUAoeZAIblmTnp7eJfeYb0uBdf4xGC1VZBGw6EwZDZD"
TWITTER_CONSUMER_ID
"xF7Mg83uy0ymt1cyvapKXE6sF"
TWITTER_CONSUMER_SECRET
"LRq6F6NROMVnECTKTXE7t8GahQwY5vyMUXxD5cv06yKxWATwYC"
TWITTER_ACCESS_TOKEN
"82350437-QroF9BX3ONUfhzDICq81wX2Ul76e8ALOtZL6KPgP9"
TWITTER_ACCESS_TOKEN_SECRET
"dLtBVOJMrgDIiCvrjTieaqVlbUQAqzaOpie8sxLqxE8PL"
INSTAGRAM_ACCESS_TOKEN
"IGQVJXQ3hSV3lXNEtNV2JkUFdpclpqSkR6ZA2JTWFlSUzctbG9PdjFYaDJ1dGNNVTRCV3BfYjJsejg2SHd5SVIwblc3ZAkVxS29hSWg0eDZAJY0xBeXA5bEhDeG9BcC14MnJaemZAaTG14QTkxaTJUZAkpHRgZDZD"
0. Whoops\Handler\PrettyPageHandler