diff --git a/Source/API/script/index.php b/Source/API/script/index.php index 3d0e787..2227ed3 100644 --- a/Source/API/script/index.php +++ b/Source/API/script/index.php @@ -34,19 +34,15 @@ try{ } unset($parameters['method']); $listGateway = array("\\Gateway\\GatewayForm", "\\Gateway\\GatewayKeyword", "\\Gateway\\GatewayQuestion"); - foreach ($listGateway as $gateway) // Pour chaque Gateway - { + foreach ($listGateway as $gateway){ if (method_exists($gateway, $method)) { - $response->getBody()->write(print_r((new $gateway)->$method($parameters))); // Si oui, on appelle cette fonction - + $response->getBody()->write(print_r((new $gateway)->$method($parameters))); } } $temp = array('response' => "Rien", 'test' => "Test Ici"); - foreach ($temp as $key => $value) { - $response->getBody()->write($key,$value); - } - return $response; - //return $response->withHeader('Content-type', 'application/json'); + $response->getBody()->write(print_r($temp)); + //return $response; + return $response->withHeader('Content-type', 'application/json'); }); }catch (TypeError $t){ echo "Error, wrong parameters key, or no parameters write : ".$t->getMessage();