diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-09-29 22:59:44 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-09-29 22:59:44 +0200 |
commit | 72fcaf8a6c7d53946a8912a99e86febc7df4b036 (patch) | |
tree | 2b2c6af2eb81f53f8223b396d95209175ea15da2 /src/Wallabag/CoreBundle/Twig | |
parent | 917040d4a0b7694ca4f695c02243ffb4283d6901 (diff) | |
download | wallabag-72fcaf8a6c7d53946a8912a99e86febc7df4b036.tar.gz wallabag-72fcaf8a6c7d53946a8912a99e86febc7df4b036.tar.zst wallabag-72fcaf8a6c7d53946a8912a99e86febc7df4b036.zip |
remove www. on entries view
Diffstat (limited to 'src/Wallabag/CoreBundle/Twig')
-rw-r--r-- | src/Wallabag/CoreBundle/Twig/WallabagExtension.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php new file mode 100644 index 00000000..f8328860 --- /dev/null +++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php | |||
@@ -0,0 +1,23 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\Twig; | ||
4 | |||
5 | class WallabagExtension extends \Twig_Extension | ||
6 | { | ||
7 | public function getFilters() | ||
8 | { | ||
9 | return array( | ||
10 | new \Twig_SimpleFilter('removeWww', array($this, 'removeWww')), | ||
11 | ); | ||
12 | } | ||
13 | |||
14 | public function removeWww($url) | ||
15 | { | ||
16 | return preg_replace('/^www\./i', '',$url); | ||
17 | } | ||
18 | |||
19 | public function getName() | ||
20 | { | ||
21 | return 'wallabag_extension'; | ||
22 | } | ||
23 | } | ||