public static function files(\Twig_Environment $environment, $files, $current, $sortOrder = null, $sortBy = null, $filter = null, $userAgentEnabled = false)
    {
        $pagelist = [];
        foreach ($files as $file) {
            if (!strpos($file, $current)) {
                $relativePath = Page::generateRelativePath($file);
                $template = $environment->load($relativePath);
                $page = new Page($template, [], $userAgentEnabled);
                $pagelist[] = $page;
            }
        }

        // apply filter
//        $pagelist = self::applyFilter( $pagelist, $filter );

        if (isset($sortBy)) {
            $pagelist = self::applySorting($pagelist, $sortOrder, $sortBy);
        }

        return new ArrayIterator($pagelist);
    }
public static function files(\Twig_Environment $environment, $files, $current, $sortOrder = null, $sortBy = null, $filter = null, $userAgentEnabled = false)
    {
        $pagelist = [];
        foreach ($files as $file) {
            if (!strpos($file, $current)) {
                $relativePath = Page::generateRelativePath($file);
                $template = $environment->load($relativePath);
                $page = new Page($template, [], $userAgentEnabled);
                $pagelist[] = $page;
            }
        }

        // apply filter
//        $pagelist = self::applyFilter( $pagelist, $filter );

        if (isset($sortBy)) {
            $pagelist = self::applySorting($pagelist, $sortOrder, $sortBy);
        }

        return new ArrayIterator($pagelist);
    }
public static function files ( \ Twig_Environment $ environment , $ files , $ current , $ sortOrder = null , $ sortBy = null , $ filter = null , $ userAgentEnabled = false ) { $ pagelist = [ ] ; foreach ( $ files as $ file ) { if ( ! strpos ( $ file , $ current ) ) { $ relativePath = Page :: generateRelativePath ( $ file ) ; $ template = $ environment -> load ( $ relativePath ) ; $ page = new Page ( $ template , [ ] , $ userAgentEnabled ) ; $ pagelist [ ] = $ page ; } } // apply filter //        $pagelist = self::applyFilter( $pagelist, $filter ); if ( isset ( $ sortBy ) ) { $ pagelist = self :: applySorting ( $ pagelist , $ sortOrder , $ sortBy ) ; } return new ArrayIterator ( $ pagelist ) ; }
Static helper method for file listings.

@param \Twig_Environment $environment
@param array             $files       Files to list
@param $current
@param null   $sortOrder
@param string $sortBy
@param null   $filter

@return ArrayIterator

@throws \Twig_Error_Loader
@throws \Twig_Error_Runtime
@throws \Twig_Error_Syntax
Static helper method for file listings .