class AbstractPaginator implements Htmlable (View source)

Methods

string
getUrlRange( int $start, int $end)

Create a range of pagination URLs.

string
url( int $page)

Get a URL for a given page number.

string|null
previousPageUrl()

Get the URL for the previous page.

$this|string|null
fragment( string|null $fragment = null)

Get / set the URL fragment to be appended to URLs.

$this
appends( array|string $key, string|null $value = null)

Add a set of query string values to the paginator.

$this
addQuery( string $key, string $value)

Add a query string value to the paginator.

array
items()

Get the slice of items being paginated.

int
firstItem()

Get the number of the first item in the slice.

int
lastItem()

Get the number of the last item in the slice.

int
perPage()

Get the number of items shown per page.

int
currentPage()

Get the current page.

bool
hasPages()

Determine if there are enough items to split into multiple pages.

static  string
resolveCurrentPath( string $default = '/')

Resolve the current request path or return the default value.

static  void
currentPathResolver( Closure $resolver)

Set the current request path resolver callback.

static  int
resolveCurrentPage( string $pageName = 'page', int $default = 1)

Resolve the current page or return the default value.

static  void
currentPageResolver( Closure $resolver)

Set the current page resolver callback.

static  void
presenter( Closure $resolver)

Set the default Presenter resolver.

string
getPageName()

Get the query string variable used to store the page.

$this
setPageName( string $name)

Set the query string variable used to store the page.

$this
setPath( string $path)

Set the base path to assign to all URLs.

getIterator()

Get an iterator for the items.

bool
isEmpty()

Determine if the list of items is empty or not.

int
count()

Get the number of items for the current page.

getCollection()

Get the paginator's underlying collection.

$this
setCollection( Collection $collection)

Set the paginator's underlying collection.

bool
offsetExists( mixed $key)

Determine if the given item exists.

mixed
offsetGet( mixed $key)

Get the item at the given offset.

void
offsetSet( mixed $key, mixed $value)

Set the item at the given offset.

void
offsetUnset( mixed $key)

Unset the item at the given key.

string
toHtml()

Render the contents of the paginator to HTML.

mixed
__call( string $method, array $parameters)

Make dynamic calls into the collection.

string
__toString()

Render the contents of the paginator when casting to string.

Details

at line line 101
string getUrlRange( int $start, int $end)

Create a range of pagination URLs.

Parameters

int $start
int $end

Return Value

string

at line line 118
string url( int $page)

Get a URL for a given page number.

Parameters

int $page

Return Value

string

at line line 144
string|null previousPageUrl()

Get the URL for the previous page.

Return Value

string|null

at line line 157
$this|string|null fragment( string|null $fragment = null)

Get / set the URL fragment to be appended to URLs.

Parameters

string|null $fragment

Return Value

$this|string|null

at line line 175
$this appends( array|string $key, string|null $value = null)

Add a set of query string values to the paginator.

Parameters

array|string $key
string|null $value

Return Value

$this

at line line 206
$this addQuery( string $key, string $value)

Add a query string value to the paginator.

Parameters

string $key
string $value

Return Value

$this

at line line 230
array items()

Get the slice of items being paginated.

Return Value

array

at line line 240
int firstItem()

Get the number of the first item in the slice.

Return Value

int

at line line 254
int lastItem()

Get the number of the last item in the slice.

Return Value

int

at line line 268
int perPage()

Get the number of items shown per page.

Return Value

int

at line line 278
int currentPage()

Get the current page.

Return Value

int

at line line 288
bool hasPages()

Determine if there are enough items to split into multiple pages.

Return Value

bool

at line line 299
static string resolveCurrentPath( string $default = '/')

Resolve the current request path or return the default value.

Parameters

string $default

Return Value

string

at line line 314
static void currentPathResolver( Closure $resolver)

Set the current request path resolver callback.

Parameters

Closure $resolver

Return Value

void

at line line 326
static int resolveCurrentPage( string $pageName = 'page', int $default = 1)

Resolve the current page or return the default value.

Parameters

string $pageName
int $default

Return Value

int

at line line 341
static void currentPageResolver( Closure $resolver)

Set the current page resolver callback.

Parameters

Closure $resolver

Return Value

void

at line line 352
static void presenter( Closure $resolver)

Set the default Presenter resolver.

Parameters

Closure $resolver

Return Value

void

at line line 362
string getPageName()

Get the query string variable used to store the page.

Return Value

string

at line line 373
$this setPageName( string $name)

Set the query string variable used to store the page.

Parameters

string $name

Return Value

$this

at line line 386
$this setPath( string $path)

Set the base path to assign to all URLs.

Parameters

string $path

Return Value

$this

at line line 398
ArrayIterator getIterator()

Get an iterator for the items.

Return Value

ArrayIterator

at line line 408
bool isEmpty()

Determine if the list of items is empty or not.

Return Value

bool

at line line 418
int count()

Get the number of items for the current page.

Return Value

int

at line line 428
Collection getCollection()

Get the paginator's underlying collection.

Return Value

Collection

at line line 439
$this setCollection( Collection $collection)

Set the paginator's underlying collection.

Parameters

Collection $collection

Return Value

$this

at line line 452
bool offsetExists( mixed $key)

Determine if the given item exists.

Parameters

mixed $key

Return Value

bool

at line line 463
mixed offsetGet( mixed $key)

Get the item at the given offset.

Parameters

mixed $key

Return Value

mixed

at line line 475
void offsetSet( mixed $key, mixed $value)

Set the item at the given offset.

Parameters

mixed $key
mixed $value

Return Value

void

at line line 486
void offsetUnset( mixed $key)

Unset the item at the given key.

Parameters

mixed $key

Return Value

void

at line line 496
string toHtml()

Render the contents of the paginator to HTML.

Return Value

string

at line line 508
mixed __call( string $method, array $parameters)

Make dynamic calls into the collection.

Parameters

string $method
array $parameters

Return Value

mixed

at line line 518
string __toString()

Render the contents of the paginator when casting to string.

Return Value

string