Browse Source

TwigExtension : rot13

master
Guillaume 3 years ago
parent
commit
33d269268e
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      Twig/TwigExtension.php

+ 6
- 0
Twig/TwigExtension.php View File

@@ -114,9 +114,15 @@ class TwigExtension extends AbstractExtension
new TwigFilter('sov_cache', [$this, 'sovCache']),
new TwigFilter('slugify', [$this, 'slugify']),
new TwigFilter('md5', [$this, 'md5']),
new TwigFilter('rot13', [$this, 'rot13']),
];
}

public function rot13(string $string): string
{
return str_rot13($string);
}

public function isInstanceOf(EntityInterface $entity, string $interfaceName)
{
$reflection = new \ReflectionClass($entity);

Loading…
Cancel
Save