Class Link
Provides helpful functionality for link headers
-
Guzzle\Http\Message\Header
implements
Guzzle\Http\Message\Header\HeaderInterface
-
Guzzle\Http\Message\Header\Link
Methods summary
public
Guzzle\Http\Message\Header\Link
|
#
addLink( string $url, string $rel, array $params = array() )
Add a link to the header
Parameters
- $url
- Link URL
- $rel
- Link rel
- $params
- Other link parameters
Returns
|
public
boolean
|
#
hasLink( string $rel )
Check if a specific link exists for a given rel attribute
Check if a specific link exists for a given rel attribute
Parameters
Returns
boolean
|
public
array|null
|
#
getLink( string $rel )
Get a specific link for a given rel attribute
Get a specific link for a given rel attribute
Parameters
Returns
array|null
|
public
array
|
#
getLinks( )
Get an associative array of links
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(
array(
'url' => 'http:/.../front.jpeg',
'rel' => 'back',
'type' => 'image/jpeg',
)
)
Returns
array
|
Methods inherited from Guzzle\Http\Message\Header
__construct(),
__toString(),
add(),
count(),
getGlue(),
getIterator(),
getName(),
hasExactHeader(),
hasValue(),
normalize(),
parseParams(),
raw(),
removeValue(),
setGlue(),
setName(),
toArray(),
trimHeader()
|