forked from wallabag/wallabag
remove www. on entries view
This commit is contained in:
23
src/Wallabag/CoreBundle/Twig/WallabagExtension.php
Normal file
23
src/Wallabag/CoreBundle/Twig/WallabagExtension.php
Normal file
@ -0,0 +1,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';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user