PHP Class Spatie\PaginateRoute\PaginateRoute

Datei anzeigen Open project: spatie/laravel-paginateroute

Protected Properties

Property Type Description
$pageKeyword string
$router Illuminate\Routing\Router
$translator Illuminate\Translation\Translator
$urlGenerator Illuminate\Contracts\Routing\UrlGenerator

Public Methods

Method Description
__construct ( Illuminate\Translation\Translator $translator, Router $router, Illuminate\Contracts\Routing\UrlGenerator $urlGenerator )
addPageQuery ( string $url, integer $page, boolean $full = false ) : string Append the page query to a URL.
allUrls ( Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator, boolean $full = false ) : array Get all urls in an array.
currentPage ( ) : integer Return the current page.
hasNextPage ( Illuminate\Contracts\Pagination\Paginator $paginator ) : boolean Determine wether there is a next page.
hasPreviousPage ( ) : boolean Determine wether there is a previous page.
isCurrentPage ( integer $page ) : boolean Check if the given page is the current page.
nextPage ( Illuminate\Contracts\Pagination\Paginator $paginator ) : string | null Get the next page number.
nextPageUrl ( Illuminate\Contracts\Pagination\Paginator $paginator ) : string | null Get the next page URL.
pageUrl ( integer $page, boolean $full = false ) : string Generate a page URL, based on the request's current URL.
previousPage ( ) : string | null Get the previous page number.
previousPageUrl ( boolean $full = false ) : string | null Get the previous page URL.
registerMacros ( ) Register the Route::paginate macro.
renderHtml ( Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator, boolean $full = false ) : string
renderPageList ( Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator, boolean $full = false, string $class = null, boolean $additionalLinks = false ) : string Render a plain html list with previous, next and all urls. The current page gets a current class on the list item.
renderRelLinks ( Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator, boolean $full = false ) : string Render html link tags for SEO indication of previous and next page.

Method Details

__construct() public method

public __construct ( Illuminate\Translation\Translator $translator, Router $router, Illuminate\Contracts\Routing\UrlGenerator $urlGenerator )
$translator Illuminate\Translation\Translator
$router Illuminate\Routing\Router
$urlGenerator Illuminate\Contracts\Routing\UrlGenerator

addPageQuery() public method

Append the page query to a URL.
public addPageQuery ( string $url, integer $page, boolean $full = false ) : string
$url string
$page integer
$full boolean Return the full version of the URL in for the first page Ex. /users/page/1 instead of /users
return string

allUrls() public method

Get all urls in an array.
public allUrls ( Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator, boolean $full = false ) : array
$paginator Illuminate\Contracts\Pagination\LengthAwarePaginator
$full boolean Return the full version of the URL in for the first page Ex. /users/page/1 instead of /users
return array

currentPage() public method

Return the current page.
public currentPage ( ) : integer
return integer

hasNextPage() public method

Determine wether there is a next page.
public hasNextPage ( Illuminate\Contracts\Pagination\Paginator $paginator ) : boolean
$paginator Illuminate\Contracts\Pagination\Paginator
return boolean

hasPreviousPage() public method

Determine wether there is a previous page.
public hasPreviousPage ( ) : boolean
return boolean

isCurrentPage() public method

Check if the given page is the current page.
public isCurrentPage ( integer $page ) : boolean
$page integer
return boolean

nextPage() public method

Get the next page number.
public nextPage ( Illuminate\Contracts\Pagination\Paginator $paginator ) : string | null
$paginator Illuminate\Contracts\Pagination\Paginator
return string | null

nextPageUrl() public method

Get the next page URL.
public nextPageUrl ( Illuminate\Contracts\Pagination\Paginator $paginator ) : string | null
$paginator Illuminate\Contracts\Pagination\Paginator
return string | null

pageUrl() public method

Generate a page URL, based on the request's current URL.
public pageUrl ( integer $page, boolean $full = false ) : string
$page integer
$full boolean Return the full version of the URL in for the first page Ex. /users/page/1 instead of /users
return string

previousPage() public method

Get the previous page number.
public previousPage ( ) : string | null
return string | null

previousPageUrl() public method

Get the previous page URL.
public previousPageUrl ( boolean $full = false ) : string | null
$full boolean Return the full version of the URL in for the first page Ex. /users/page/1 instead of /users
return string | null

registerMacros() public method

Register the Route::paginate macro.
public registerMacros ( )

renderHtml() public method

Deprecation: in favor of renderPageList.
public renderHtml ( Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator, boolean $full = false ) : string
$paginator Illuminate\Contracts\Pagination\LengthAwarePaginator
$full boolean Return the full version of the URL in for the first page Ex. /users/page/1 instead of /users
return string

renderPageList() public method

Render a plain html list with previous, next and all urls. The current page gets a current class on the list item.
public renderPageList ( Illuminate\Contracts\Pagination\LengthAwarePaginator $paginator, boolean $full = false, string $class = null, boolean $additionalLinks = false ) : string
$paginator Illuminate\Contracts\Pagination\LengthAwarePaginator
$full boolean Return the full version of the URL in for the first page Ex. /users/page/1 instead of /users
$class string Include class on pagination list Ex.
    $additionalLinks boolean Include prev and next links on pagination list
    return string

    Property Details

    $pageKeyword protected_oe property

    protected string $pageKeyword
    return string

    $router protected_oe property

    protected Router,Illuminate\Routing $router
    return Illuminate\Routing\Router

    $translator protected_oe property

    protected Translator,Illuminate\Translation $translator
    return Illuminate\Translation\Translator

    $urlGenerator protected_oe property

    protected UrlGenerator,Illuminate\Contracts\Routing $urlGenerator
    return Illuminate\Contracts\Routing\UrlGenerator