class PaginationLinks extends GroupedTagBuilder

Methods

static string
key()

Get the builder key.

overlayOn(TagBuilder|null $base)

Replace the lower layer's pagination links.

bool
isEmpty()

Determine whether no pagination links are defined.

static string
headArrayKey()

Get the key used in the head array.

static mixed
headArrayDefault()

Grouped tag builders are represented as an empty array when absent from the Head::toArray() result.

static array
routeAttributeKeys()

Get the supported route attribute names.

static TagBuilder|null
fromRouteAttribute(string $key, mixed $value)

Create a builder from a route attribute value, or null when the value is invalid.

static bool
rendersWhenEmpty(ResolvedHead $head)

Determine if the builder should render even when no data was set.

asDefaults()

Mark the builder's data as belonging to the defaults layer.

mixed
toHeadArray(ResolvedHead $head)

Get the pagination links for the head array.

array
toTags(ResolvedHead $head, TagRenderer $tags)

Render the pagination link tags.

static string|null
string(mixed $value)

Return the value when it is a string.

static string|null
stringOrBackedEnum(mixed $value)

Resolve a string or string-backed enum value.

static bool|null
bool(mixed $value)

Return the value when it is a boolean.

static int|null
int(mixed $value)

Return the value when it is an integer.

static array
items(mixed $value)

Normalize a route attribute value into a list of items.

static array
named(array $values)

Filter an array down to its string-keyed values.

__construct(array $links = [])

Create the pagination links.

static PaginationLinks
fromPaginator(Paginator|CursorPaginator $paginator)

Create previous and next links from a paginator.

link(string $rel, string $href)

Set a pagination link by relation.

Details

at line 29
static string key()

Get the builder key.

Return Value

string

at line 85
TagBuilder overlayOn(TagBuilder|null $base)

Replace the lower layer's pagination links.

Parameters

TagBuilder|null $base

Return Value

TagBuilder

at line 94
bool isEmpty()

Determine whether no pagination links are defined.

Return Value

bool

at line 37
static string headArrayKey()

Get the key used in the head array.

Return Value

string

in GroupedTagBuilder at line 13
static mixed headArrayDefault()

Grouped tag builders are represented as an empty array when absent from the Head::toArray() result.

Return Value

mixed

at line 47
static array routeAttributeKeys()

Get the supported route attribute names.

Return Value

array

in TagBuilder at line 58
static TagBuilder|null fromRouteAttribute(string $key, mixed $value)

Create a builder from a route attribute value, or null when the value is invalid.

Parameters

string $key
mixed $value

Return Value

TagBuilder|null

in TagBuilder at line 66
static bool rendersWhenEmpty(ResolvedHead $head)

Determine if the builder should render even when no data was set.

Parameters

ResolvedHead $head

Return Value

bool

in TagBuilder at line 74
TagBuilder asDefaults()

Mark the builder's data as belonging to the defaults layer.

Return Value

TagBuilder

at line 104
mixed toHeadArray(ResolvedHead $head)

Get the pagination links for the head array.

Parameters

ResolvedHead $head

Return Value

mixed

at line 114
array toTags(ResolvedHead $head, TagRenderer $tags)

Render the pagination link tags.

Parameters

ResolvedHead $head
TagRenderer $tags

Return Value

array

in TagBuilder at line 100
static protected string|null string(mixed $value)

Return the value when it is a string.

Parameters

mixed $value

Return Value

string|null

in TagBuilder at line 108
static protected string|null stringOrBackedEnum(mixed $value)

Resolve a string or string-backed enum value.

Parameters

mixed $value

Return Value

string|null

in TagBuilder at line 124
static protected bool|null bool(mixed $value)

Return the value when it is a boolean.

Parameters

mixed $value

Return Value

bool|null

in TagBuilder at line 132
static protected int|null int(mixed $value)

Return the value when it is an integer.

Parameters

mixed $value

Return Value

int|null

in TagBuilder at line 142
static protected array items(mixed $value)

Normalize a route attribute value into a list of items.

Parameters

mixed $value

Return Value

array

in TagBuilder at line 153
static protected array named(array $values)

Filter an array down to its string-keyed values.

Parameters

array $values

Return Value

array

at line 22
__construct(array $links = [])

Create the pagination links.

Parameters

array $links

at line 57
static PaginationLinks fromPaginator(Paginator|CursorPaginator $paginator)

Create previous and next links from a paginator.

Parameters

Paginator|CursorPaginator $paginator

Return Value

PaginationLinks

Set a pagination link by relation.

Parameters

string $rel
string $href

Return Value

PaginationLinks