瀏覽代碼

TwigExtension : rot13

master
Guillaume 3 年之前
父節點
當前提交
33d269268e
共有 1 個檔案被更改,包括 6 行新增0 行删除
  1. +6
    -0
      Twig/TwigExtension.php

+ 6
- 0
Twig/TwigExtension.php 查看文件

@@ -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…
取消
儲存