<?php header('Content-Type: text/html; charset=utf-8'); define("PASTA", "d:/httpc/tcm/"); define("PATH", "http://localhost/tcm/"); date_default_timezone_set('UTC'); include PASTA . "admin/class/config/Autoload.php"; include PASTA . "admin/class/config/AutoloadEntidade.php"; $autoload = new AutoloadEntidade(PASTA); $postdata = file_get_contents("php://input"); $request = json_decode($postdata, true); $texto = new Texto(); $texto->serializeArray("Texto", (array) $request); $textoService = new TextoService(); $method = $_GET['sub']; call_user_func($method, $texto); function carregaTextoComFotos($texto) { global $textoService; $lista = $textoService->buscarComFotos($texto); echo json_encode($lista); }