Tuum/Respond
is a framework agnostic PHP module to
help construct a PSR-7 response object, and more.
It provides MVC's "View" functionality as shown in the figure below.
In this figure, the Controller part is managed by the framework
and Tuum/Respond
composes a respond object for views
(using template), error pages, and redirects.
$app->add('/',
function (ServerRequestInterface $request, ResponseInterface $response) use ($responder) {
return $responder->view($request, $response)
->setSuccess('welcome!')
->render('index');
});
Tuum/Respond
?Micro frameworks with middleware are very simple yet gives a great power on building a web application, but may not provide some useful features such as,
With Tuum/Respond, it will be very easy to implement:
Please use the composer to install Tuum/Respond
;
$ composer require "tuum/respond:^3.0"
The repository includes a demo site to demonstrate what Tuum/Respond can do. To see the demo site;
composer install
,/public
,php -S localhost:8000 index.php
, andlocalhost:8000
via browser.There is a demo with Slim3 framework, slim-tuum repository, for more realistic demo.