PHPackages                             maikwoehl/rest-recipes - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. maikwoehl/rest-recipes

ActiveLibrary[API Development](/categories/api)

maikwoehl/rest-recipes
======================

Collection of classes and scripts for REST apis

0.1.6(10y ago)049MITPHPPHP &gt;=5.5.0

Since May 27Pushed 10y ago1 watchersCompare

[ Source](https://github.com/maikwoehl/rest-recipes)[ Packagist](https://packagist.org/packages/maikwoehl/rest-recipes)[ RSS](/packages/maikwoehl-rest-recipes/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (7)Used By (0)

rest-recipes
============

[](#rest-recipes)

Router
------

[](#router)

Routes a request to specific endpoint and extracts variables.

A route must begin with '/'.

The order of the parameters of the route and the parameters of the routeFunction should be the same.

The order of routes must be in a order like:

- /recipe/
- /recipe/create (e.g. default data and id as response)
- /recipe/create/&lt;name&gt; (specific name for creation and id as response)
- /recipe/&lt;id&gt;
- /recipe/&lt;id&gt;/export
- /recipe/&lt;id&gt;/&lt;someVar&gt;

### Usage

[](#usage)

```
