Skip to main content

The OutputProcessors

An OutputProcessor will parse the $response->write($obj) and output in the proper format. The available handlers are:

  • JsonOutputProcessor
  • XmlOutputProcessor
  • HtmlHandler
  • JsonCleanOutputProcessor

Using Custom Response Handler

The Default Response Handler will process all "$response->write" into a JSON. You can choose another Handlers. See below for a list of Available Response Handlers.

require_once __DIR__ . '/../vendor/autoload.php';

$routeDefinition = new \ByJG\RestServer\Route\RouteList();
->withClass(\My\ClassName::class, "someMethod")

$restServer = new \ByJG\RestServer\HttpRequestHandler();