Download the PHP package k7/nette-rest-route without Composer
On this page you can find all versions of the php package k7/nette-rest-route. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download k7/nette-rest-route
More information about k7/nette-rest-route
Files in k7/nette-rest-route
Package nette-rest-route
Short Description Rest route for Nette Framework
License MIT
Homepage https://github.com/newPOPE/Nette-RestRoute
Informations about the package nette-rest-route
REST route for Nette Framework
Route automatically maps CRUD to Presenters and actions in the defined module. And creates parameters which are accessible in Presenter.
- format
- id (autodetected)
- associations (an array with associations)
- data (raw data from the request)
- query (an array of items from the query string)
Format detection:
Variable is detected from HTTP header . If header is not present Route try detect format from the URL (). If no format is in the URL Route use a default format .
Installation:
The best way to install Nette-RestRoute is using Composer:
Usage:
First parameter is a name of the module where the route will sends an Request. URL prefix will be generated. See examples.
Examples:
Second parameter is default format. By default the default format is . RestRoute support only 2 formats:
- json (default)
- xml
Examples
Read all:
URL: →
HTTP HEADER Accept:
Method: GET
Request body: Empty
Params:
Flag was dropped and
Route
automatically generate actionreadAll
if no Resource ID was not found in the URL.
Read with resource ID
URL: →
HTTP HEADER Accept:
Method: GET
Request body: Empty
Params:
Query params:
URL: →
HTTP HEADER Accept:
Method: GET
Request body: Empty
Params:
Create:
URL: →
HTTP HEADER Accept:
Method: POST
Request body:
Params:
Update:
URL: →
HTTP HEADER Accept:
Method: PUT
Request body:
Params:
Partial update:
URL: →
HTTP HEADER Accept:
Method: PATCH
Request body:
Params:
Delete:
URL: →
HTTP HEADER Accept:
Method: DELETE
Request body: Empty
Params:
Options:
For more about OPTIONS documentation see w3.org.
URL: →
HTTP HEADER Accept:
Method: OPTIONS
Request body: Empty
Params:
Associations:
Last item (pair) before .
URL: →
HTTP HEADER Accept:
Method: GET, POST, PUT, DELETE
Request body: Empty
Params:
URL: →
HTTP HEADER Accept:
Method: GET, POST, PUT, DELETE
Request body: Empty
Params:
URL: →
HTTP HEADER Accept:
Method: GET, POST, PUT, DELETE
Request body: Empty
Params:
Overriding methods PUT, PATCH, DELETE
Methods , and can be overriden via:
HTTP header
Example:
Query param
Example:
Development
RestRoute is developed in Docker container via docker-compose
command.
Example:
Attach to container:
All versions of nette-rest-route with dependencies
nette/application Version ~2.3
nette/http Version ~2.3
nette/utils Version ~2.3