Procházet zdrojové kódy

[Templating] added a __isset() method to the Engine

Fabien Potencier před 15 roky
rodič
revize
04a0032293
1 změnil soubory, kde provedl 12 přidání a 0 odebrání
  1. 12 0
      src/Symfony/Components/Templating/Engine.php

+ 12 - 0
src/Symfony/Components/Templating/Engine.php

@@ -152,6 +152,18 @@ class Engine
         return $this->$name = $this->get($name);
     }
 
+    /**
+     * Returns true if the helper if defined.
+     *
+     * @param string  $name The helper name
+     *
+     * @return Boolean true if the helper is defined, false otherwise
+     */
+    public function __isset($name)
+    {
+        return isset($this->helpers[$name]);
+    }
+
     /**
      * @param Helper[] $helpers An array of helper
      */