Skip to content

Commit

Permalink
[Templating] fixed PHP renderer when using a template variable named …
Browse files Browse the repository at this point in the history
…'template'
  • Loading branch information
fabpot committed Aug 25, 2010
1 parent 271b963 commit bf67562
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Symfony/Component/Templating/Renderer/PhpRenderer.php
Expand Up @@ -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();
}
Expand Down

0 comments on commit bf67562

Please sign in to comment.