xenin / route-manager
Simple REST API Route Manager
1.0.0
2016-03-08 05:34 UTC
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2025-01-16 00:27:28 UTC
README
A Simple REST API Route Manager for PHP. Create named routes for easy access to REST APIs. RouteManager will assemble and return complete route from pattern supplied.
Basic Usage
// create instance $xn = new \xenin\RouteManager('http://api-base-url'); // setup routes $xn->add('user', '/user/{userID}/account'); $xn->add('message', '/user/{userID}/messages/{messageID}'); // get routes $usrRoute = $xn->get('user', array('userID' => 'f445ea85')); $msgRoute = $xn->get('message', array('userID' => 'f445ea85','messageID' => 42));