public function pager(Environment $env, $pagerName = '', $surr = 4, $template = '_sub_pager.twig', $class = '')
    {
        if ($this->pagerManager->isEmptyPager()) {
            // nothing to page.
            return '';
        }

        $thisPager = $this->pagerManager->getPager($pagerName);

        $context = [
            'pager'    => $thisPager,
            'surr'     => $surr, // @deprecated
            'surround' => $surr,
            'class'    => $class,
        ];

        /* Little hack to avoid doubling this function and having context without breaking frontend */
        if ($template === 'backend') {
            $template = '@bolt/components/pager.twig';
        }

        return $env->render($template, $context);
    }
public function pager(Environment $env, $pagerName = '', $surr = 4, $template = '_sub_pager.twig', $class = '')
    {
        if ($this->pagerManager->isEmptyPager()) {
            // nothing to page.
            return '';
        }

        $thisPager = $this->pagerManager->getPager($pagerName);

        $context = [
            'pager'    => $thisPager,
            'surr'     => $surr, // @deprecated
            'surround' => $surr,
            'class'    => $class,
        ];

        /* Little hack to avoid doubling this function and having context without breaking frontend */
        if ($template === 'backend') {
            $template = '@bolt/components/pager.twig';
        }

        return $env->render($template, $context);
    }
public function pager ( Environment $ env , $ pagerName = '' , $ surr = 4 , $ template = '_sub_pager.twig' , $ class = '' ) { if ( $ this -> pagerManager -> isEmptyPager ( ) ) { // nothing to page. return '' ; } $ thisPager = $ this -> pagerManager -> getPager ( $ pagerName ) ; $ context = [ 'pager' => $ thisPager , 'surr' => $ surr , // @deprecated 'surround' => $ surr , 'class' => $ class , ] ; /* Little hack to avoid doubling this function and having context without breaking frontend */ if ( $ template === 'backend' ) { $ template = '@bolt/components/pager.twig' ; } return $ env -> render ( $ template , $ context ) ; }
Output a simple pager, for paginated listing pages.

@param Environment $env
@param string      $pagerName
@param int         $surr
@param string      $template  The template to apply
@param string      $class

@return string The rendered pager HTML
Output a simple pager for paginated listing pages .