Example for API

This commit is contained in:
mathieu committed 2018-12-13 10:55:35 +09:00
1 parent cf4ad2b1cc
commit cce4b1f186
3 files changed
+23 -6

No files matched your search

+7 -3
View File
@@ -5,19 +5,23 @@ namespace WebProjectFitness\API;
class APIUser extends API {
private $declaredFunctions = [
'insert' => [
'create' => [
'method' => 'POST',
'params' => [
'name' => [
'id' => [
'required' => true,
'type' => 'string'
]
]
],
]
];
public function __construct() {
parent::__construct( $this->declaredFunctions );
}
public function create( $data ) {
$this->returnJson( [ 'body' => 'truc', 'id' => $data[ 'id' ] ] );
}
}