public function addEspectacle() { $postdata = file_get_contents("php://input"); $request = json_decode($postdata, true); try { $EM = new EntradesModel(); $RET = $EM->addEspectacle($request['data']); echo json_encode($RET); } catch (\Exception $e) { Err::throwError($e); } }