https://github.com/photon/api-json
Helper to write API with json payload
https://github.com/photon/api-json
Last synced: 10 months ago
JSON representation
Helper to write API with json payload
- Host: GitHub
- URL: https://github.com/photon/api-json
- Owner: photon
- License: lgpl-2.1
- Created: 2017-10-10T20:37:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-20T13:36:14.000Z (over 5 years ago)
- Last Synced: 2025-07-19T20:43:56.515Z (11 months ago)
- Language: PHP
- Size: 25.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
api-json
========
Views helper to create REST APIs
Quick start
-----------
1) Add the module
Use composer to add the module in your project
composer require "photon/api-json:dev-master"
or for a specific version
composer require "photon/api-json:1.0.0"
2) Create an API Endpoint
Each class will handle all HTTP methods for an URL
class MyAPIEndpoint extends \photon\views\APIJson\Rest
{
public function GET($request, $match)
{
return array(
'ok' => true,
'method' => $request->method
);
}
}
3) Enjoy !