]>
Commit | Line | Data |
---|---|---|
72fcaf8a NL |
1 | <?php |
2 | ||
3 | namespace Wallabag\CoreBundle\Twig; | |
4 | ||
5 | class WallabagExtension extends \Twig_Extension | |
6 | { | |
7 | public function getFilters() | |
8 | { | |
4094ea47 JB |
9 | return [ |
10 | new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']), | |
11 | ]; | |
72fcaf8a NL |
12 | } |
13 | ||
14 | public function removeWww($url) | |
15 | { | |
cfb28c9d | 16 | return preg_replace('/^www\./i', '', $url); |
72fcaf8a NL |
17 | } |
18 | ||
19 | public function getName() | |
20 | { | |
21 | return 'wallabag_extension'; | |
22 | } | |
23 | } |