Skip to content
PHP Ecosystem
Explore

Link

API reference › yii › web › Link

classyii\web\Link
Extendsyii\base\BaseObject
Implementsyii\base\Configurable
Since2.0
Sourceframework/web/Link.php

Link represents a link object as defined in JSON Hypermedia API Language.

PropertyTypeDescriptionDefined by
$hrefstringA URI RFC3986 or URI template RFC6570. Default: null.Link
$hreflangstringThe language of the target resource Default: null.Link
$namestringA secondary key for selecting Link Objects which share the same relation type Default: null.Link
$profilestringA URI that hints about the profile of the target resource. Default: null.Link
$templatedboolA value indicating whether $href refers to a URI or URI template. Default: false.Link
$titlestringA label describing the link Default: null.Link
$typestringA hint to indicate the media type expected when dereferencing the target resource Default: null.Link
MethodDescriptionDefined by
__construct()Constructor.yii\base\BaseObject
__call()Calls the named method which is not a class method.yii\base\BaseObject
__get()Returns the value of an object property.yii\base\BaseObject
__isset()Checks if a property is set, i.e. defined and not null.yii\base\BaseObject
__set()Sets value of an object property.yii\base\BaseObject
__unset()Sets an object property to null.yii\base\BaseObject
canGetProperty()Returns a value indicating whether a property can be read.yii\base\BaseObject
canSetProperty()Returns a value indicating whether a property can be set.yii\base\BaseObject
className() staticReturns the fully qualified name of this class.yii\base\BaseObject
hasMethod()Returns a value indicating whether a method is defined.yii\base\BaseObject
hasProperty()Returns a value indicating whether a property is defined.yii\base\BaseObject
init()Initializes the object.yii\base\BaseObject
serialize() staticSerializes a list of links into proper array format.Link
ConstantValueDescriptionDefined by
REL_SELF'self'The self link.Link
public string $href = null

A URI RFC3986 or URI template RFC6570.

This property is required.

public static function serialize(array $links): array

Serializes a list of links into proper array format.

Parameters

ParameterTypeDescription
$linksarrayThe links to be serialized

Returns

array: The proper array representation of the links.