浏览代码

Let Pico::getTwigVariables() return the "real" array

Currently Pico::getTwigVariables() always returns the default twig variables and ignores all additions/changes made through the onPageRendering event. The method now returns the "real" variables array used by Twig.
Daniel Rudolf 8 年之前
父节点
当前提交
5d48aa7040
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      lib/Pico.php

+ 4 - 0
lib/Pico.php

@@ -1474,6 +1474,10 @@ class Pico
      */
      */
     protected function getTwigVariables()
     protected function getTwigVariables()
     {
     {
+        if ($this->twigVariables !== null) {
+            return $this->twigVariables;
+        }
+
         $frontPage = $this->getConfig('content_dir') . 'index' . $this->getConfig('content_ext');
         $frontPage = $this->getConfig('content_dir') . 'index' . $this->getConfig('content_ext');
         return array(
         return array(
             'config' => $this->getConfig(),
             'config' => $this->getConfig(),