Example for API
This commit is contained in:
@ -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' ] ] );
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user