Class Guzzle\Http\Message\Header\Link

InheritanceGuzzle\Http\Message\Header\Link » Guzzle\Http\Message\Header

Provides helpful functionality for link headers

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
trimHeader() Trim a header by removing excess spaces and wrapping quotes Guzzle\Http\Message\Header

Method Details

addLink() public method

Add a link to the header

public self addLink ( $url, $rel, array $params = [] )
$url string

Link URL

$rel string

Link rel

$params array

Other link parameters

getLink() public method

Get a specific link for a given rel attribute

public array|null getLink ( $rel )
$rel string

Rel value

getLinks() public method

Get an associative array of links

For example: Link: <http:/.../front.jpeg>; rel=front; type="image/jpeg", http://.../back.jpeg; rel=back; type="image/jpeg"

var_export($response->getLinks()); array(

    'url' => 'http:/.../front.jpeg',
    'rel' => 'back',
    'type' => 'image/jpeg',


public array getLinks ( )
hasLink() public method

Check if a specific link exists for a given rel attribute

public bool hasLink ( $rel )
$rel string

Rel value