final class BreadcrumbTrail (View source)

Holds ordered caller-owned breadcrumb items until a renderer presents them.

Methods

add(string $label, string|null $url = null)

Appends one item after existing trail items.

prepend(string $label, string|null $url = null)

Inserts one item before all existing trail items.

clear()

Removes every item while preserving the mutable trail instance.

int
count()

Returns the number of items in display order.

int
array
items()

Returns the ordered items without applying presentation-specific state.

array

Details

add

BreadcrumbTrail add(string $label, string|null $url = null)

Appends one item after existing trail items.

Parameters

string $label
string|null $url

Return Value

BreadcrumbTrail

prepend

BreadcrumbTrail prepend(string $label, string|null $url = null)

Inserts one item before all existing trail items.

Parameters

string $label
string|null $url

Return Value

BreadcrumbTrail

clear

Removes every item while preserving the mutable trail instance.

Return Value

BreadcrumbTrail

count

int count()

Returns the number of items in display order.

Return Value

int

items

array items()

Returns the ordered items without applying presentation-specific state.

Return Value

array