|
@@ -14,7 +14,6 @@ namespace Symfony\Bundle\TwigBundle\Extension;
|
|
|
use Symfony\Component\DependencyInjection\ContainerInterface;
|
|
|
use Symfony\Bundle\TwigBundle\TokenParser\IncludeTokenParser;
|
|
|
use Symfony\Bundle\TwigBundle\TokenParser\RenderTokenParser;
|
|
|
-use Symfony\Component\Yaml\Dumper as YamlDumper;
|
|
|
|
|
|
/**
|
|
|
*
|
|
@@ -45,8 +44,6 @@ class TemplatingExtension extends \Twig_Extension
|
|
|
public function getFilters()
|
|
|
{
|
|
|
return array(
|
|
|
- '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'))),
|
|
|
'format_args' => new \Twig_Filter_Method($this, 'formatArgs', array('is_safe' => array('html'))),
|
|
@@ -111,17 +108,6 @@ class TemplatingExtension extends \Twig_Extension
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- public function yamlEncode($input, $inline = 0)
|
|
|
- {
|
|
|
- static $dumper;
|
|
|
-
|
|
|
- if (null === $dumper) {
|
|
|
- $dumper = new YamlDumper();
|
|
|
- }
|
|
|
-
|
|
|
- return $dumper->dump($input, $inline);
|
|
|
- }
|
|
|
-
|
|
|
public function abbrClass($class)
|
|
|
{
|
|
|
return $this->container->get('templating.helper.code')->abbrClass($class);
|
|
@@ -162,19 +148,6 @@ class TemplatingExtension extends \Twig_Extension
|
|
|
return $this->container->get('templating.helper.code')->formatFileFromText($text);
|
|
|
}
|
|
|
|
|
|
- public function dump($value)
|
|
|
- {
|
|
|
- if (is_resource($value)) {
|
|
|
- return '%Resource%';
|
|
|
- }
|
|
|
-
|
|
|
- if (is_array($value) || is_object($value)) {
|
|
|
- return '%'.gettype($value).'% '.$this->yamlEncode($value);
|
|
|
- }
|
|
|
-
|
|
|
- return $value;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* Returns the name of the extension.
|
|
|
*
|