Created
August 27, 2015 20:26
-
-
Save brense/60afb72fd8f46ea99fc5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$service = new Service(); | |
$clientResource = new Resource('/client', new Client(), new ClientController); | |
$clientResource->addCustomRoute('GET', '/find', array(new ClientController, 'find'), array('name')); | |
$service->addResource($clientResource); | |
$request = Request::current(); | |
$request->setBootstrapPath('/service'); // e.g. when the full path is http://www.mydomain.com/service | |
$response = $service->resolve($request); | |
echo $response; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment