mirror of
https://github.com/wallabag/wallabag.git
synced 2024-06-08 16:29:30 +00:00
24 lines
421 B
PHP
24 lines
421 B
PHP
<?php
|
|
|
|
namespace Wallabag\CoreBundle\Twig;
|
|
|
|
class WallabagExtension extends \Twig_Extension
|
|
{
|
|
public function getFilters()
|
|
{
|
|
return [
|
|
new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']),
|
|
];
|
|
}
|
|
|
|
public function removeWww($url)
|
|
{
|
|
return preg_replace('/^www\./i', '', $url);
|
|
}
|
|
|
|
public function getName()
|
|
{
|
|
return 'wallabag_extension';
|
|
}
|
|
}
|