diff --git a/src/Symfony/Bundle/TwigBundle/Extension/TemplatingExtension.php b/src/Symfony/Bundle/TwigBundle/Extension/TemplatingExtension.php index e0d295f11c19..09628b15b72b 100644 --- a/src/Symfony/Bundle/TwigBundle/Extension/TemplatingExtension.php +++ b/src/Symfony/Bundle/TwigBundle/Extension/TemplatingExtension.php @@ -49,7 +49,7 @@ public function getTemplating() public function getFilters() { return array( - 'yaml' => new \Twig_Filter_Method($this, 'yaml'), + 'yaml_encode' => new \Twig_Filter_Method($this, 'yamlEncode'), 'dump' => new \Twig_Filter_Method($this, 'dump'), 'abbr_class' => new \Twig_Filter_Method($this, 'abbrClass', array('is_safe' => array('html'))), 'abbr_method' => new \Twig_Filter_Method($this, 'abbrMethod', array('is_safe' => array('html'))), @@ -101,7 +101,7 @@ public function getTokenParsers() ); } - public function yaml($input, $inline = 0) + public function yamlEncode($input, $inline = 0) { static $dumper; @@ -154,7 +154,7 @@ public function dump($value) } if (is_array($value) || is_object($value)) { - return '%'.gettype($value).'% '.$this->yaml($value); + return '%'.gettype($value).'% '.$this->yamlEncode($value); } return $value;