class Route implements RouteInterface, HasQueryFilterInterface (View source)

Represent a route

Traits

Represent an object which has an array of attributes.
Represent an object which has a WordPress query filter attribute.

Methods

mixed
getAttribute(string $attribute, mixed $default = '')

Get attribute.

array
getAttributes()

Get all attributes.

void
setAttribute(string $attribute, mixed $value)

Set attribute.

attribute(string $attribute, mixed $value)

Fluent alias for setAttribute().

void
setAttributes(array $attributes)

Set all attributes.

attributes(array $attributes)

Fluent alias for setAttributes().

array
applyQueryFilter(RequestInterface $request, array $query_vars)

Apply the query filter, if any.

boolean
isSatisfied(RequestInterface $request)

Get whether the route is satisfied.

array
getArguments(RequestInterface $request)

Get arguments.

Details

abstract mixed getAttribute(string $attribute, mixed $default = '')

Get attribute.

Parameters

string $attribute
mixed $default

Return Value

mixed

array getAttributes()

Get all attributes.

Return Value

array mixed>

void setAttribute(string $attribute, mixed $value)

Set attribute.

Parameters

string $attribute
mixed $value

Return Value

void

HasAttributesTrait attribute(string $attribute, mixed $value)

Fluent alias for setAttribute().

Parameters

string $attribute
mixed $value

Return Value

HasAttributesTrait $this

void setAttributes(array $attributes)

Set all attributes.

No attempt to merge attributes is done - this is a direct overwrite operation.

Parameters

array $attributes mixed> $attributes

Return Value

void

HasAttributesTrait attributes(array $attributes)

Fluent alias for setAttributes().

Parameters

array $attributes mixed> $attributes

Return Value

HasAttributesTrait $this

array applyQueryFilter(RequestInterface $request, array $query_vars)

Apply the query filter, if any.

Parameters

RequestInterface $request
array $query_vars

Return Value

array

boolean isSatisfied(RequestInterface $request)

Get whether the route is satisfied.

Parameters

RequestInterface $request

Return Value

boolean

array getArguments(RequestInterface $request)

Get arguments.

Parameters

RequestInterface $request

Return Value

array