CodeCanyon - Tiny REST Framework
Category: Plugins/Modules
- views: 5 854
- date: 15 August 2010
- posted by: SharePlus

Tiny REST Framework
This very lightweight framework will help you create RESTful API ’s very easily in PHP outputting data as XML , JSON, CSV , HTML tables, Serialized arrays and pure PHP .
The API can responding to HTTP GET , POST, PUT & DELETE and also supports HTTP Basic / Digest Authentication.
Usage
The idea is to create controllers which represent your resources, or a group of resources. A resource could be “user”, “article”, “shoes”, whatever. You can see how these controllers should look by opening /controllers/user.php.
Keeping with the user example, you can react based on the URL and the HTTP verb used to access the controller. If you access via the browser you will be using GET , so:
/users
...would call index_get() in your controller.
/users?id=1
This would mean you could use $this->get(‘id’) to return 1.
Create, fetch or interact with your data in any way you like then use self::response() or $this->response() to send back data. The 1st argument should be an array and the 2nd is an optional HTTP status code. It will send 200 by default but you could reply with:
self::response(array(‘error’ => ‘Couldn\’t find any users!’), 404);
You can also create sub-resources in your controllers. A sub-resource for user could be “profile”.
/users/profile?id=1
This would map to profile_get() and you would again use $this->get(‘id’) to work out who for.
You can use cURL or manually create your HTTP requests to send data in POST , PUT or DELETE form. If using PUT or DELETE via cURL you should set the HTTP method as usual then send POSTFIELD data.
You can get the parameters for requests using:
$this->get() $this->post() $this->put() $this->delete()
The API can responding to HTTP GET , POST, PUT & DELETE and also supports HTTP Basic / Digest Authentication.
Usage
The idea is to create controllers which represent your resources, or a group of resources. A resource could be “user”, “article”, “shoes”, whatever. You can see how these controllers should look by opening /controllers/user.php.
Keeping with the user example, you can react based on the URL and the HTTP verb used to access the controller. If you access via the browser you will be using GET , so:
/users
...would call index_get() in your controller.
/users?id=1
This would mean you could use $this->get(‘id’) to return 1.
Create, fetch or interact with your data in any way you like then use self::response() or $this->response() to send back data. The 1st argument should be an array and the 2nd is an optional HTTP status code. It will send 200 by default but you could reply with:
self::response(array(‘error’ => ‘Couldn\’t find any users!’), 404);
You can also create sub-resources in your controllers. A sub-resource for user could be “profile”.
/users/profile?id=1
This would map to profile_get() and you would again use $this->get(‘id’) to work out who for.
You can use cURL or manually create your HTTP requests to send data in POST , PUT or DELETE form. If using PUT or DELETE via cURL you should set the HTTP method as usual then send POSTFIELD data.
You can get the parameters for requests using:
$this->get() $this->post() $this->put() $this->delete()
Demo:
http://codecanyon.net/item/tiny-rest-framework/full_screen_preview/99263
DOWNLOAD FROM HOTFILE:
http://hotfile.com/dl/62146110/9785a64/tiny-rest.rar.html
Please - don't forget to say - THANK YOU.
NO HOTFILE MIRRORS, PLEASE..! If you add HOTFILE MIRROR - IT WILL BE DELETED
We need your support!
Make a donation to help us stay online
Bitcoin (BTC)
bc1q08g9d22cxkawsjlf8etuek2pc9n2a3hs4cdrld
Bitcoin Cash (BCH)
qqvwexzhvgauxq2apgc4j0ewvcak6hh6lsnzmvtkem
Ethereum (ETH)
0xb55513D2c91A6e3c497621644ec99e206CDaf239
Litecoin (LTC)
ltc1qt6g2trfv9tjs4qj68sqc4uf0ukvc9jpnsyt59u
USDT (ERC20)
0xb55513D2c91A6e3c497621644ec99e206CDaf239
USDT (TRC20)
TYdPNrz7v1P9riWBWZ317oBgJueheGjATm
Information |
|||
![]() |
Users of GUESTS are not allowed to comment this publication. | ||









