Documentation

Link
in package
implements EvolvableLinkInterface

Table of Contents

Interfaces

EvolvableLinkInterface
An evolvable link value object.

Constants

REL_ALTERNATE  = 'alternate'
REL_AUTHOR  = 'author'
REL_DNS_PREFETCH  = 'dns-prefetch'
REL_HELP  = 'help'
REL_ICON  = 'icon'
REL_LICENSE  = 'license'
REL_MERCURE  = 'mercure'
REL_NEXT  = 'next'
REL_PRECONNECT  = 'preconnect'
REL_PREFETCH  = 'prefetch'
REL_PRELOAD  = 'preload'
REL_PRERENDER  = 'prerender'
REL_PREV  = 'prev'
REL_SEARCH  = 'search'
REL_STYLESHEET  = 'stylesheet'

Properties

$attributes  : array<string, string|bool|array<string|int, string>>
$href  : string
$rel  : array<string|int, string>

Methods

__construct()  : mixed
getAttributes()  : array<string|int, mixed>
{@inheritdoc}
getHref()  : string
{@inheritdoc}
getRels()  : array<string|int, mixed>
{@inheritdoc}
isTemplated()  : bool
{@inheritdoc}
withAttribute()  : static
Returns an instance with the specified attribute added.
withHref()  : static
Returns an instance with the specified href.
withoutAttribute()  : static
Returns an instance with the specified attribute excluded.
withoutRel()  : static
Returns an instance with the specified relationship excluded.
withRel()  : static
Returns an instance with the specified relationship included.
hrefIsTemplated()  : bool

Constants

REL_ALTERNATE

public mixed REL_ALTERNATE = 'alternate'

REL_AUTHOR

public mixed REL_AUTHOR = 'author'

REL_DNS_PREFETCH

public mixed REL_DNS_PREFETCH = 'dns-prefetch'

REL_HELP

public mixed REL_HELP = 'help'

REL_ICON

public mixed REL_ICON = 'icon'

REL_LICENSE

public mixed REL_LICENSE = 'license'

REL_MERCURE

public mixed REL_MERCURE = 'mercure'

REL_NEXT

public mixed REL_NEXT = 'next'

REL_PRECONNECT

public mixed REL_PRECONNECT = 'preconnect'

REL_PREFETCH

public mixed REL_PREFETCH = 'prefetch'

REL_PRELOAD

public mixed REL_PRELOAD = 'preload'

REL_PRERENDER

public mixed REL_PRERENDER = 'prerender'

REL_PREV

public mixed REL_PREV = 'prev'
public mixed REL_SEARCH = 'search'

REL_STYLESHEET

public mixed REL_STYLESHEET = 'stylesheet'

Properties

$attributes

private array<string, string|bool|array<string|int, string>> $attributes = []

$href

private string $href = ''

$rel

private array<string|int, string> $rel = []

Methods

__construct()

public __construct([string $rel = null ][, string $href = '' ]) : mixed
Parameters
$rel : string = null
$href : string = ''

getAttributes()

{@inheritdoc}

public getAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getHref()

{@inheritdoc}

public getHref() : string
Return values
string

getRels()

{@inheritdoc}

public getRels() : array<string|int, mixed>
Return values
array<string|int, mixed>

isTemplated()

{@inheritdoc}

public isTemplated() : bool
Return values
bool

withAttribute()

Returns an instance with the specified attribute added.

public withAttribute(string $attribute, string|Stringable|int|float|bool|array<string|int, mixed> $value) : static
Parameters
$attribute : string

The attribute to include.

$value : string|Stringable|int|float|bool|array<string|int, mixed>

The value of the attribute to set.

Return values
static

withHref()

Returns an instance with the specified href.

public withHref(string|Stringable $href) : static
Parameters
$href : string|Stringable

The href value to include. It must be one of: - An absolute URI, as defined by RFC 5988. - A relative URI, as defined by RFC 5988. The base of the relative link is assumed to be known based on context by the client. - A URI template as defined by RFC 6570. - An object implementing __toString() that produces one of the above values.

An implementing library SHOULD evaluate a passed object to a string immediately rather than waiting for it to be returned later.

Return values
static

withoutAttribute()

Returns an instance with the specified attribute excluded.

public withoutAttribute(string $attribute) : static
Parameters
$attribute : string

The attribute to remove.

Return values
static

withoutRel()

Returns an instance with the specified relationship excluded.

public withoutRel(string $rel) : static
Parameters
$rel : string

The relationship value to exclude.

Return values
static

withRel()

Returns an instance with the specified relationship included.

public withRel(string $rel) : static
Parameters
$rel : string

The relationship value to add.

Return values
static

hrefIsTemplated()

private hrefIsTemplated(string $href) : bool
Parameters
$href : string
Return values
bool

        
On this page

Search results