aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
blob: 6b860c96c2af5135157171c9bbf0846f1f1fdf3b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php

namespace Wallabag\CoreBundle\Twig;

class WallabagExtension extends \Twig_Extension
{
    public function getFilters()
    {
        return array(
            new \Twig_SimpleFilter('removeWww', array($this, 'removeWww')),
        );
    }

    public function removeWww($url)
    {
        return preg_replace('/^www\./i', '', $url);
    }

    public function getName()
    {
        return 'wallabag_extension';
    }
}