Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 343 Bytes

LinkBuilder.md

File metadata and controls

21 lines (15 loc) · 343 Bytes

LinkBuilder

<?php

use Chubbyphp\Serialization\Link\LinkBuilder;

$link = LinkBuilder::create('/api/model')
    ->setRels(['model'])
    ->setAttributes(['method' => 'GET'])
    ->getLink();

echo $link->getHref();
// '/api/model'

print_r($link->getRels());
// ['model']

print_r($link->getAttributes());
// ['method' => 'GET']