소스 검색

[Templating] fixed PHP renderer when using a template variable named 'template'

Fabien Potencier 14 년 전
부모
커밋
bf67562268
1개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 4
      src/Symfony/Component/Templating/Renderer/PhpRenderer.php

+ 5 - 4
src/Symfony/Component/Templating/Renderer/PhpRenderer.php

@@ -32,18 +32,19 @@ class PhpRenderer extends Renderer
      */
     public function evaluate(Storage $template, array $parameters = array())
     {
-        if ($template instanceof FileStorage) {
+        $__template__ = $template;
+        if ($__template__ instanceof FileStorage) {
             extract($parameters);
             $view = $this->engine;
             ob_start();
-            require $template;
+            require $__template__;
 
             return ob_get_clean();
-        } else if ($template instanceof StringStorage) {
+        } elseif ($__template__ instanceof StringStorage) {
             extract($parameters);
             $view = $this->engine;
             ob_start();
-            eval('; ?>'.$template.'<?php ;');
+            eval('; ?>'.$__template__.'<?php ;');
 
             return ob_get_clean();
         }