Swat/SwatPagination.php
protected function calculatePages()
    {
        $this->total_pages = ceil($this->total_records / $this->page_size);

        if (
            $this->total_pages <= 1 ||
            $this->total_pages == $this->current_page
        ) {
            $this->next_page = 0;
        } else {
            $this->next_page = $this->current_page + 1;
        }

        if ($this->current_page > 0) {
            $this->prev_page = $this->current_page - 1;
        } else {
            $this->prev_page = 0;
        }
    }
protected function calculatePages()
    {
        $this->total_pages = ceil($this->total_records / $this->page_size);

        if (
            $this->total_pages <= 1 ||
            $this->total_pages == $this->current_page
        ) {
            $this->next_page = 0;
        } else {
            $this->next_page = $this->current_page + 1;
        }

        if ($this->current_page > 0) {
            $this->prev_page = $this->current_page - 1;
        } else {
            $this->prev_page = 0;
        }
    }
protected function calculatePages ( ) { $ this -> total_pages = ceil ( $ this -> total_records / $ this -> page_size ) ; if ( $ this -> total_pages <= 1 || $ this -> total_pages == $ this -> current_page ) { $ this -> next_page = 0 ; } else { $ this -> next_page = $ this -> current_page + 1 ; } if ( $ this -> current_page > 0 ) { $ this -> prev_page = $ this -> current_page - 1 ; } else { $ this -> prev_page = 0 ; } }
Calculates page totals

Sets the internal total_pages, next_page and prev_page properties.
Calculates page totals