Bolt\Twig\TwigExtension::getFilters PHP Method

getFilters() public method

public getFilters ( )
    public function getFilters()
    {
        $safe = ['is_safe' => ['html']];
        $env = ['needs_environment' => true];
        $deprecated = ['deprecated' => true];
        return [new \Twig_SimpleFilter('__', [$this, 'trans']), new \Twig_SimpleFilter('current', [$this, 'current']), new \Twig_SimpleFilter('editable', [$this, 'editable'], $safe), new \Twig_SimpleFilter('excerpt', [$this, 'excerpt'], $safe), new \Twig_SimpleFilter('image', [$this, 'image']), new \Twig_SimpleFilter('imageinfo', [$this, 'imageInfo']), new \Twig_SimpleFilter('json_decode', [$this, 'jsonDecode']), new \Twig_SimpleFilter('localedatetime', [$this, 'localeDateTime'], $safe), new \Twig_SimpleFilter('loglevel', [$this, 'logLevel']), new \Twig_SimpleFilter('markdown', [$this, 'markdown'], $safe), new \Twig_SimpleFilter('order', [$this, 'order']), new \Twig_SimpleFilter('popup', [$this, 'popup'], $safe), new \Twig_SimpleFilter('preg_replace', [$this, 'pregReplace']), new \Twig_SimpleFilter('safestring', [$this, 'safeString'], $safe), new \Twig_SimpleFilter('selectfield', [$this, 'selectField']), new \Twig_SimpleFilter('showimage', [$this, 'showImage'], $safe), new \Twig_SimpleFilter('shuffle', [$this, 'shuffle']), new \Twig_SimpleFilter('shy', [$this, 'shy'], $safe), new \Twig_SimpleFilter('slug', [$this, 'slug']), new \Twig_SimpleFilter('thumbnail', [$this, 'thumbnail']), new \Twig_SimpleFilter('tt', [$this, 'decorateTT'], $safe), new \Twig_SimpleFilter('twig', [$this, 'twig'], $safe), new \Twig_SimpleFilter('ucfirst', 'twig_capitalize_string_filter', $env + $deprecated + ['alternative' => 'capitalize']), new \Twig_SimpleFilter('ymllink', [$this, 'ymllink'], $safe)];
    }

Usage Example

コード例 #1
0
ファイル: TwigExtensionTest.php プロジェクト: Twiebie/bolt
 public function testTwigInterface()
 {
     $app = $this->getApp();
     $handlers = $this->getTwigHandlers($app);
     $twig = new TwigExtension($app, $handlers, false);
     $this->assertGreaterThan(0, $twig->getFunctions());
     $this->assertGreaterThan(0, $twig->getFilters());
     $this->assertGreaterThan(0, $twig->getTests());
     $this->assertEquals('Bolt', $twig->getName());
 }