Set pager
@return array
769341
protected function setPagerListFile()
    {
        $conditions = $this->query_filter;
        $conditions['count'] = true;

        $pager = array(
            'query' => $this->query_filter,
            'total' => (int) $this->file->getList($conditions)
        );

        return $this->data_limit = $this->setPager($pager);
    }
816030
protected function _setPagingParams()
    {
        $controller = $this->getController();
        $request = $controller->getRequest();
        $paging = $this->_paginator->getPagingParams() + (array)$request->getParam('paging', []);

        $controller->setRequest($request->withParam('paging', $paging));
    }
49537
public function getPager()
    {
        if (!isset($this->pager) && $this->usePcntl()) {
            if ($pager = \ini_get('cli.pager')) {
                // use the default pager
                $this->pager = $pager;
            } elseif ($less = \exec('which less 2>/dev/null')) {
                // check for the presence of less...
                $this->pager = $less . ' -R -S -F -X';
            }
        }

        return $this->pager;
    }
956573
public function getPaginator()
    {
        if (!empty($this->paginator)) {
            $this->paginator->setId($this->getId());
        }
        return $this->paginator;
    }
491661
public function getPagination(): array
    {
        if ($this->pagination === null) {
            $this->pagination = $this->setPagination();
        }

        return $this->pagination;
    }
363366
public function setPager($name, $pager)
    {
        $pg = $this->app['pager']->createPager($name);

        foreach ($pager as $prop => $value) {
            $pg->$prop = $value;
        }

        return $this;
    }
519767
protected function setPagerListTrigger()
    {
        $conditions = $this->query_filter;
        $conditions['count'] = true;

        $pager = array(
            'query' => $this->query_filter,
            'total' => (int) $this->trigger->getList($conditions)
        );

        return $this->data_limit = $this->setPager($pager);
    }
647903
protected function setPage ()
        {
            $urlTemplates = [];

            if ($this->arParams['SEF_MODE'] === 'Y')
            {
                $variables = [];

                $urlTemplates = \CComponentEngine::MakeComponentUrlTemplates (
                    $this->defaultUrlTemplates404,
                    $this->arParams['SEF_URL_TEMPLATES']
                );

                $variableAliases = \CComponentEngine::MakeComponentVariableAliases (
                    $this->defaultUrlTemplates404,
                    $this->arParams['VARIABLE_ALIASES']
                );

                $this->templatePage = \CComponentEngine::ParseComponentPath (
                    $this->arParams['SEF_FOLDER'],
                    $urlTemplates,
                    $variables
                );

                if (!$this->templatePage)
                {
                    if ($this->arParams['SET_404'] === 'Y')
                    {
                        $folder404 = str_replace ('\\', '/', $this->arParams['SEF_FOLDER']);

                        if ($folder404 != '/')
                        {
                            $folder404 = '/' . trim ($folder404, "/ \t\n\r\0\x0B") . "/";
                        }

                        if (substr ($folder404, - 1) == '/')
                        {
                            $folder404 .= 'index.php';
                        }

                        if ($folder404 != Main\Context::getCurrent ()->getRequest ()->getRequestedPage ())
                        {
                            $this->return404 ();
                        }
                    }

                    $this->templatePage = $this->defaultSefPage;
                }

                if ($this->isSearchRequest () && $this->arParams['USE_SEARCH'] === 'Y')
                {
                    $this->templatePage = 'search';
                }

                \CComponentEngine::InitComponentVariables (
                    $this->templatePage,
                    $this->componentVariables,
                    $variableAliases,
                    $variables
                );

                $models = $this->setModels ();
            } else
            {
                $this->templatePage = $this->defaultPage;
            }

            $this->sefFolder = $this->arParams['SEF_FOLDER'];
            $this->urlTemplates = $urlTemplates;
            $this->variables = $variables;
            $this->variableAliases = $variableAliases;
            $this->models = $models;
        }
726838
public function PaginatedList()
    {
        $all_posts = $this->blogPosts ?: ArrayList::create();

        $posts = PaginatedList::create($all_posts);

        $posts->setPageLength($this->PostsPerPage);

        // Set current page
        $start = $this->request->getVar($posts->getPaginationGetVar());
        $posts->setPageStart($start);

        return $posts;
    }
245475
protected function setPagerListReportRoute()
    {
        $pager = array(
            'query' => $this->query_filter,
            'total' => (int) $this->getListReportRoute(true)
        );

        return $this->data_limit = $this->setPager($pager);
    }
131756
public function PagedReplies()
    {
        $list = $this->Replies();

        // Add pagination
        $list = new PaginatedList($list, Controller::curr()->getRequest());
        $list->setPaginationGetVar('repliesstart' . $this->ID);
        $list->setPageLength($this->getOption('comments_per_page'));

        $this->extend('updatePagedReplies', $list);
        return $list;
    }
1205667
private function setPagination()
    {
        // ALl Pages
        if ($this->perPage == 'all') return;

        $this->firstPage    = 1;
        $this->lastPage     = ceil($this->totalCount / $this->perPage);

        // if current page is greater than the total page
        // then set the current page equal to total page
        $this->page = min($this->page, $this->lastPage);

        // Calculate the offset of where the retrieval index start at
        $this->offset   = ($this->page - 1) * $this->perPage;
        $this->limit    = $this->perPage;

        // Next Page And Previous Page
        $this->nextPage = min($this->page + 1, $this->lastPage);
        $this->prevPage = max($this->page - 1, $this->firstPage);
    }
838776
protected function setPagerListCategoryGroup()
    {
        $options = $this->query_filter;
        $options['count'] = true;

        $pager = array(
            'query' => $this->query_filter,
            'total' => (int) $this->category_group->getList($options)
        );

        return $this->data_limit = $this->setPager($pager);
    }
1076480
public function setPageContent()
	{
		$content = "---\n";
		$content .= "type: ". $this->properties['type'] . "\n";
		$content .= "layout: " . $this->properties['layout'] . "\n";
		$content .= "title: " . $this->properties['title'] . "\n";
		$content .= "---\n";
		$content .= $this->properties['body'];

		return $content;
	}
781649
public function pager(ODataQueryPager $pager = NULL) {
        if (isset($pager)) {
            $this->setPager($pager);
            return $this;
        }
        return $this->getPager();
    }
715684
protected function paginationRanger()
    {
        $parameters = [
            'first' => $this->paginator->firstItem(),
            'last'  => $this->paginator->lastItem(),
            'total' => $this->paginator->total(),
        ];

        $parameters = collect($parameters)->flatMap(function ($parameter, $key) {
            return [$key => "<b>$parameter</b>"];
        });

        return trans('admin.pagination.range', $parameters->all());
    }
1219672
public function renderPager()
	{
		if (!$this->json) {
			parent::renderPager();
			return true;
		}

		$pager = array();
		if (is_string($this->pager)) {
			$class = $this->pager;
		} else if (is_array($this->pager)) {
			$pager = $this->pager;
			if (isset($pager['class'])) {
				$class = $pager['class'];
				unset($pager['class']);
			}
		}
		$pager['pages'] = $this->dataProvider->getPagination();

		if ($pager['pages']->getPageCount() > 1) {
			$pager['json'] = $this->json;
			$widget = $this->createWidget($class, $pager);

			return $widget->run();
		} else {
			return array();
		}
	}