소스 검색

[TwigBundle] renamed yaml filter to yaml_encode (to be coherent with json_encode)

Fabien Potencier 14 년 전
부모
커밋
e3551b5f87
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      src/Symfony/Bundle/TwigBundle/Extension/TemplatingExtension.php

+ 3 - 3
src/Symfony/Bundle/TwigBundle/Extension/TemplatingExtension.php

@@ -49,7 +49,7 @@ class TemplatingExtension extends \Twig_Extension
     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 @@ class TemplatingExtension extends \Twig_Extension
         );
     }
 
-    public function yaml($input, $inline = 0)
+    public function yamlEncode($input, $inline = 0)
     {
         static $dumper;
 
@@ -154,7 +154,7 @@ class TemplatingExtension extends \Twig_Extension
         }
 
         if (is_array($value) || is_object($value)) {
-            return '%'.gettype($value).'% '.$this->yaml($value);
+            return '%'.gettype($value).'% '.$this->yamlEncode($value);
         }
 
         return $value;