Pager example


    public static function pager(?PagerConfig $config = null, ?RendererInterface $view = null, bool $getShared = true)
    {
        if ($getShared) {
            return static::getSharedInstance('pager', $config$view);
        }

        $config ??= config(PagerConfig::class);
        $view ??= AppServices::renderer(null, null, false);

        return new Pager($config$view);
    }

    /** * The Parser is a simple template parser. * * @return Parser */
    public static function parser(?string $viewPath = null, ?ViewConfig $config = null, bool $getShared = true)
    {
        if ($getShared) {
            return static::getSharedInstance('parser', $viewPath$config);
        }

  public function __construct(PagerParametersInterface $pager_params) {
    $this->pagerParams = $pager_params;
  }

  /** * {@inheritdoc} */
  public function createPager($total$limit$element = 0) {
    $currentPage = $this->pagerParams->findPage($element);
    $pager = new Pager($total$limit$currentPage);
    $this->setPager($pager$element);
    return $pager;
  }

  /** * {@inheritdoc} */
  public function getPager($element = 0) {
    return $this->pagers[$element] ?? NULL;
  }

  
Home | Imprint | This part of the site doesn't use cookies.