Last active
March 23, 2020 10:00
-
-
Save zburgermeiszter/b8c5c1cf4e1830cd66e6 to your computer and use it in GitHub Desktop.
TWIG MD5 extension for Symfony
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Vendor\Bundle\Twig; | |
/* | |
services.yml: | |
twig.md5: | |
class: Vendor\Bundle\Twig\Md5 | |
tags : | |
- { name: twig.extension } | |
*/ | |
class Md5 extends \Twig_Extension { | |
public function getFilters(){ | |
return array( | |
new \Twig_SimpleFilter('md5', 'md5') | |
); | |
} | |
public function getName(){ | |
return "md5_hash"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment