Methods summary
protected
|
#
__construct( array $results, integer $page, integer $total, integer $per_page, integer $last )
Create a new Paginator instance.
Create a new Paginator instance.
Parameters
- $results
array $results
- $page
integer $page
- $total
integer $total
- $per_page
integer $per_page
- $last
integer $last
|
public static
Laravel\Paginator
|
#
make( array $results, integer $total, integer $per_page )
Create a new Paginator instance.
Create a new Paginator instance.
Parameters
- $results
array $results
- $total
integer $total
- $per_page
integer $per_page
Returns
|
public static
integer
|
#
page( integer $total, integer $per_page )
Get the current page from the request query string.
Get the current page from the request query string.
Parameters
- $total
integer $total
- $per_page
integer $per_page
Returns
integer
|
protected static
boolean
|
#
valid( integer $page )
Determine if a given page number is a valid page.
Determine if a given page number is a valid page.
A valid page must be greater than or equal to one and a valid integer.
Parameters
Returns
boolean
|
public
string
|
#
links( integer $adjacent = 3 )
Create the HTML pagination links.
Create the HTML pagination links.
Typically, an intelligent, "sliding" window of links will be rendered based
on the total number of pages, the current page, and the number of adjacent pages
that should rendered. This creates a beautiful paginator similar to that of
Google's.
Example: 1 2 ... 23 24 25 [26] 27 28 29 ... 51 52
If you wish to render only certain elements of the pagination control,
explore some of the other public methods available on the instance.
echo $paginator->links();
echo $paginator->links(5);
Parameters
- $adjacent
integer $adjacent
Returns
string
|
public
string
|
#
slider( integer $adjacent = 3 )
Build sliding list of HTML numeric page links.
Build sliding list of HTML numeric page links.
This method is very similar to the "links" method, only it does not render
the "first" and "last" pagination links, but only the pages.
echo $paginator->slider();
echo $paginator->slider(5);
Parameters
- $adjacent
integer $adjacent
Returns
string
|
public
string
|
#
previous( string $text = null )
Generate the "previous" HTML link.
Generate the "previous" HTML link.
echo $paginator->previous();
echo $paginator->previous('Go Back');
Parameters
Returns
string
|
public
string
|
#
next( string $text = null )
Generate the "next" HTML link.
Generate the "next" HTML link.
echo $paginator->next();
echo $paginator->next('Skip Forwards');
Parameters
Returns
string
|
protected
string
|
#
element( string $element, integer $page, string $text, Closure $disabled )
Create a chronological pagination element, such as a "previous" or "next"
link.
Create a chronological pagination element, such as a "previous" or "next"
link.
Parameters
- $element
string $element
- $page
integer $page
- $text
string $text
- $disabled
Closure
$disabled
Returns
string
|
protected
string
|
#
beginning( )
Build the first two page links for a sliding page range.
Build the first two page links for a sliding page range.
Returns
string
|
protected
string
|
#
ending( )
Build the last two page links for a sliding page range.
Build the last two page links for a sliding page range.
Returns
string
|
protected
string
|
#
range( integer $start, integer $end )
Build a range of numeric pagination links.
Build a range of numeric pagination links.
For the current page, an HTML span element will be generated instead of a
link.
Parameters
- $start
integer $start
- $end
integer $end
Returns
string
|
protected
string
|
#
link( integer $page, string $text, string $class )
Create a HTML page link.
Parameters
- $page
integer $page
- $text
string $text
- $class
string $class
Returns
string
|
protected
string
|
#
appendage( array $appends )
Create the "appendage" to be attached to every pagination link.
Create the "appendage" to be attached to every pagination link.
Parameters
Returns
string
|
public
Laravel\Paginator
|
#
appends( array $values )
Set the items that should be appended to the link query strings.
Set the items that should be appended to the link query strings.
Parameters
Returns
|
public
Laravel\Paginator
|
#
speaks( string $language )
Set the language that should be used when creating the pagination links.
Set the language that should be used when creating the pagination links.
Parameters
- $language
string $language
Returns
|
Properties summary
public
array
|
$results
|
|
#
The results for the current page.
The results for the current page.
|
public
integer
|
$page
|
|
|
public
integer
|
$last
|
|
#
The last page available for the result set.
The last page available for the result set.
|
public
integer
|
$total
|
|
#
The total number of results.
The total number of results.
|
public
integer
|
$per_page
|
|
#
The number of items per page.
The number of items per page.
|
protected
array
|
$appends
|
|
#
The values that should be appended to the end of the link query strings.
The values that should be appended to the end of the link query strings.
|
protected
string
|
$appendage
|
|
#
The compiled appendage that will be appended to the links.
The compiled appendage that will be appended to the links.
This consists of a sprintf format with a page place-holder and query
string.
|
protected
string
|
$language
|
|
#
The language that should be used when creating the pagination links.
The language that should be used when creating the pagination links.
|
protected
string
|
$dots
|
'<li class="dots disabled"><a href="#">...</a></li>' |
#
The "dots" element used in the pagination slider.
The "dots" element used in the pagination slider.
|