Paginator
class Paginator
Paginating math.
Properties
| int | $page | ||
| int | $base | ||
| positive-int | $itemsPerPage | ||
| int<0, max>|null | $itemCount | ||
| int read-only | $firstPage | ||
| int|null read-only | $lastPage | ||
| int<0, max> read-only | $firstItemOnPage | ||
| int<0, max> read-only | $lastItemOnPage | ||
| bool read-only | $first | ||
| bool read-only | $last | ||
| int<0, max>|null read-only | $pageCount | ||
| int<0, max> read-only | $offset | ||
| int<0, max>|null read-only | $countdownOffset | ||
| int<0, max> read-only | $length | 
Methods
Returns current page number.
Returns first page number.
Returns last page number.
Returns the sequence number of the first element on the page
Returns the sequence number of the last element on the page
Returns first page (base) number.
Returns zero-based page number.
Is the current page the first one?
Is the current page the last one?
Returns the total number of pages.
Sets the number of items to display on a single page.
Returns the number of items to display on a single page.
Sets the total number of items.
Returns the total number of items.
Returns the absolute index of the first item on current page.
Returns the absolute index of the first item on current page in countdown paging.
Returns the number of items on current page.
Details
        at line 51
                            Paginator
    setPage(int $page)
        
    
    Sets current page number.
        at line 61
                            int
    getPage()
        
    
    Returns current page number.
        at line 70
                            int
    getFirstPage()
        
    
    Returns first page number.
        at line 79
                            int|null
    getLastPage()
        
    
    Returns last page number.
        at line 91
                            int
    getFirstItemOnPage()
        
    
    Returns the sequence number of the first element on the page
        at line 103
                            int
    getLastItemOnPage()
        
    
    Returns the sequence number of the last element on the page
        at line 112
                            Paginator
    setBase(int $base)
        
    
    Sets first page (base) number.
        at line 122
                            int
    getBase()
        
    
    Returns first page (base) number.
        at line 132
                    protected        int
    getPageIndex()
        
    
    Returns zero-based page number.
        at line 144
                            bool
    isFirst()
        
    
    Is the current page the first one?
        at line 153
                            bool
    isLast()
        
    
    Is the current page the last one?
        at line 165
                            int|null
    getPageCount()
        
    
    Returns the total number of pages.
        at line 176
                            Paginator
    setItemsPerPage(int $itemsPerPage)
        
    
    Sets the number of items to display on a single page.
        at line 187
                            int
    getItemsPerPage()
        
    
    Returns the number of items to display on a single page.
        at line 196
                            Paginator
    setItemCount(int|null $itemCount = null)
        
    
    Sets the total number of items.
        at line 207
                            int|null
    getItemCount()
        
    
    Returns the total number of items.
        at line 217
                            int
    getOffset()
        
    
    Returns the absolute index of the first item on current page.
        at line 227
                            int|null
    getCountdownOffset()
        
    
    Returns the absolute index of the first item on current page in countdown paging.
        at line 239
                            int
    getLength()
        
    
    Returns the number of items on current page.
Traits
Strict class for better experience.