All of your WordPress and Router controllers should return PSR7 compliant response. The most common use-case is rendering a twig view and passing in some context. Using Timber it would look like this:
As we make use of a great 3rd party package: Zend Diactoros, Lumberjack includes an array of handy responses out-of-the-box.
$response = new Rareloop\Lumberjack\Http\Responses\TimberResponse('home', $context);
// Check out their documentation for further details and examples:
// https://zendframework.github.io/zend-diactoros/
$response = new Zend\Diactoros\Response\TextResponse('Hello world!');
$response = new Zend\Diactoros\Response\HtmlResponse($htmlContent);
$response = new Zend\Diactoros\Response\XmlResponse($xml);
$response = new Zend\Diactoros\Response\JsonResponse($data);
$response = new Zend\Diactoros\Response\EmptyResponse(); // Basic 204 response:
$response = new Zend\Diactoros\Response\RedirectResponse('/user/login');