Download the PHP package nuxnik/collection-plus-json without Composer
On this page you can find all versions of the php package nuxnik/collection-plus-json. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nuxnik/collection-plus-json
More information about nuxnik/collection-plus-json
Files in nuxnik/collection-plus-json
Package collection-plus-json
Short Description Lightweight PHP Library for manipulation of Collection+Json hypermedia-type objects. Can be used as server or client
License MIT
Homepage https://github.com/nuxnik/collection-json-php
Informations about the package collection-plus-json
collectionPlusJson-php
version: 1.0.0
Introduction
Collection+JSON is a JSON-based read/write hypermedia-type designed to support management and querying of simple collections.
The Collection+JSON hypermedia type is designed to support full read/write capability for simple lists (contacts, >tasks, blog entries, etc.). The standard application semantics supported by this media type include Create, Read, Update, >and Delete (CRUD) along w/ support for predefined queries including query templates (similar to HTML "GET" forms). Write >operations are defined using a template object supplied by the server as part of the response representation."
From Collection+JSON site
Installation
-
Install composer.phar (if you don't already have it)
-
Edit your
composer.json
file to include the library -
Check you are good to go
That code should output:
Example
Consume a Collection+JSON object
This functionality enables a plain json string in Collection+JSON format to be consumed and translated into a Collection object for easy manipulation.
Example with transfer object:
Example with template object from POST/PUT request. See Collection+JSON Documentation for details
Create a client to communicate with Collection+JSON server
GET all data
If the JSON object is the same as the one above the following will be output:
GET single item and update it
If the JSON object is the same as the one above the following will be output:
POST and DELETE single item
If the JSON object is the same as the one above the following will be output:
Crawl / follow links
If the JSON object is the same as the one above the following will be output: