Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joshuaestes/hal
My hal+json stuff
https://github.com/joshuaestes/hal
Last synced: 1 day ago
JSON representation
My hal+json stuff
- Host: GitHub
- URL: https://github.com/joshuaestes/hal
- Owner: JoshuaEstes
- Created: 2012-11-02T17:57:42.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-04-27T21:46:42.000Z (over 11 years ago)
- Last Synced: 2024-11-08T05:41:48.944Z (about 2 months ago)
- Language: PHP
- Size: 133 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hal/Hal package
This package is used to create hal json. It's quick and dirty and the only
reason it exists is for my own education. Feel free to use it.# Usage
title = 'Test Product';
// Add the resource to your main resource
$resource->addResource($productResource);// You can add more links too
$resource->addLink(new Link('/location/next', 'next'));
$resource->addLink(new Link('/location/previous', 'previous'));// Now you can dump the json
echo $resource->asJson();# Testing
Be sure to install composer.phar
php composer.phar install --dev
php bin/phpunit