Landish\Pagination\Pagination::getNextButton PHP Method

getNextButton() protected method

Get the next page pagination element.
protected getNextButton ( ) : string
return string
    protected function getNextButton()
    {
        // If the current page is greater than or equal to the last page, it means we
        // can't go any further into the pages, as we're already on this last page
        // that is available, so we will make it the "next" link style disabled.
        if (!$this->paginator->hasMorePages()) {
            return $this->getDisabledTextWrapper($this->getNextButtonText());
        }
        $url = $this->paginator->url($this->paginator->currentPage() + 1);
        return $this->getPageLinkWrapper($url, $this->getNextButtonText());
    }

Usage Example

Example #1
0
 protected function getNextButton()
 {
     $replacements = ['disabled' => 'disabled next', '<li>' => '<li class="next">', 'span' => 'a'];
     return str_replace(array_keys($replacements), array_values($replacements), parent::getNextButton());
 }