Skip to content

Commit

Permalink
🔨 #270 nova classe
Browse files Browse the repository at this point in the history
  • Loading branch information
bjverde committed Jul 30, 2022
1 parent 9bc5daa commit c07c893
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions appexemplo_v2.0/api/api_controllers/TGenericAPI.class.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
namespace api_controllers;

use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;

class TGenericAPI
{
public function __construct()
{
}

public static function getBodyJson($msg, Response $response)
{
$msgJson = json_encode($msg);
$response->getBody()->write( $msgJson );
return $response->withHeader('Content-Type', 'application/json');
}
}

0 comments on commit c07c893

Please sign in to comment.