public function getFilters()
    {
        $parser = \Parsedown::instance();
        $translator = $this->translator;
        $routeRenderer = $this->routeRenderer;

        return array(
            'markdown' => new \Twig_SimpleFilter(
                'markdown',
                function ($value) use ($parser) {
                    return $parser->text($value);
                }
            ),
            'trans' => new \Twig_SimpleFilter(
                'trans',
                function ($value, $context) use ($translator) {
                    if (!$context) {
                        $context = array();
                    }

                    return vsprintf($translator->translate($value), $context);
                }
            ),
            'route' => new \Twig_SimpleFilter(
                'route',
                function ($value, $presentation = 'normal') use ($routeRenderer) {
                    return $routeRenderer->render($value, $presentation);
                }
            ),
            'sort' => new \Twig_SimpleFilter(
                'sort_*',
                function ($direction, $collection) {
                    if (!$collection instanceof Collection) {
                        return $collection;
                    }

                    $iterator = $collection->getIterator();
                    $iterator->uasort(
                        function ($a, $b) use ($direction) {
                            $aElem = strtolower($a->getName());
                            $bElem = strtolower($b->getName());
                            if ($aElem === $bElem) {
                                return 0;
                            }
                            if ($direction === 'asc' && $aElem > $bElem || $direction === 'desc' && $aElem < $bElem) {
                                return 1;
                            }

                            return -1;
                        }
                    );

                    return $iterator;
                }
            ),
        );
    }
public function getFilters()
    {
        $parser = \Parsedown::instance();
        $translator = $this->translator;
        $routeRenderer = $this->routeRenderer;

        return array(
            'markdown' => new \Twig_SimpleFilter(
                'markdown',
                function ($value) use ($parser) {
                    return $parser->text($value);
                }
            ),
            'trans' => new \Twig_SimpleFilter(
                'trans',
                function ($value, $context) use ($translator) {
                    if (!$context) {
                        $context = array();
                    }

                    return vsprintf($translator->translate($value), $context);
                }
            ),
            'route' => new \Twig_SimpleFilter(
                'route',
                function ($value, $presentation = 'normal') use ($routeRenderer) {
                    return $routeRenderer->render($value, $presentation);
                }
            ),
            'sort' => new \Twig_SimpleFilter(
                'sort_*',
                function ($direction, $collection) {
                    if (!$collection instanceof Collection) {
                        return $collection;
                    }

                    $iterator = $collection->getIterator();
                    $iterator->uasort(
                        function ($a, $b) use ($direction) {
                            $aElem = strtolower($a->getName());
                            $bElem = strtolower($b->getName());
                            if ($aElem === $bElem) {
                                return 0;
                            }
                            if ($direction === 'asc' && $aElem > $bElem || $direction === 'desc' && $aElem < $bElem) {
                                return 1;
                            }

                            return -1;
                        }
                    );

                    return $iterator;
                }
            ),
        );
    }
public function getFilters ( ) { $ parser = \ Parsedown :: instance ( ) ; $ translator = $ this -> translator ; $ routeRenderer = $ this -> routeRenderer ; return array ( 'markdown' => new \ Twig_SimpleFilter ( 'markdown' , function ( $ value ) use ( $ parser ) { return $ parser -> text ( $ value ) ; } ) , 'trans' => new \ Twig_SimpleFilter ( 'trans' , function ( $ value , $ context ) use ( $ translator ) { if ( ! $ context ) { $ context = array ( ) ; } return vsprintf ( $ translator -> translate ( $ value ) , $ context ) ; } ) , 'route' => new \ Twig_SimpleFilter ( 'route' , function ( $ value , $ presentation = 'normal' ) use ( $ routeRenderer ) { return $ routeRenderer -> render ( $ value , $ presentation ) ; } ) , 'sort' => new \ Twig_SimpleFilter ( 'sort_*' , function ( $ direction , $ collection ) { if ( ! $ collection instanceof Collection ) { return $ collection ; } $ iterator = $ collection -> getIterator ( ) ; $ iterator -> uasort ( function ( $ a , $ b ) use ( $ direction ) { $ aElem = strtolower ( $ a -> getName ( ) ) ; $ bElem = strtolower ( $ b -> getName ( ) ) ; if ( $ aElem === $ bElem ) { return 0 ; } if ( $ direction === 'asc' && $ aElem > $ bElem || $ direction === 'desc' && $ aElem < $ bElem ) { return 1 ; } return - 1 ; } ) ; return $ iterator ; } ) , ) ; }
Returns a list of all filters that are exposed by this extension.

@return \Twig_SimpleFilter[]
Returns a list of all filters that are exposed by this extension .