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

new TwigFilter('sov_cache', [$this, 'sovCache']), new TwigFilter('sov_cache', [$this, 'sovCache']),
new TwigFilter('slugify', [$this, 'slugify']), new TwigFilter('slugify', [$this, 'slugify']),
new TwigFilter('md5', [$this, 'md5']), 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) public function isInstanceOf(EntityInterface $entity, string $interfaceName)
{ {
$reflection = new \ReflectionClass($entity); $reflection = new \ReflectionClass($entity);

Loading…
Cancel
Save