1. Go to this page and download the library: Download aeq/hal library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
aeq / hal example snippets
$posts = $resource->getLink('posts')->follow();
$explorer = new Explorer();
$explorer->setClientAdapter(new GuzzleClientAdapter(new Client()));
$explorer->setSerializer(new JsonSerializer());
use Aeq\Hal\Client\ClientAdapterInterface;
class MyCustomClientAdapter implements ClientAdapterInterface
{
public function request($method, $uri = null, array $options = [])
{
// call your custom client and return the response
}
}
use Aeq\Hal\Serializer\SerializerInterface;
class MyCustomSerializer implements SerializerInterface
{
public function serialize($data)
{
// serialize your data: $data
}
public function deserialize($str)
{
// deserialize the string: $str
}
}