소스 검색

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

Fabien Potencier 15 년 전
부모
커밋
04a0032293
1개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  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
      */