Manage action for http message
composer require seeren/controller
Retrieve PSR-7 Response for JSON format
use Seeren\Controller\JsonController;
$controller = new JsonController();
$response = $controller->render(['foo' => 'bar']);
Retrieve PSR-7 Response for HTML format
use Seeren\Controller\HTMLController;
$controller = new HTMLController();
$response = $controller->render('template.html.php', [
'title' => 'Hello World'
]);
By default, templates folder is in /templates
and include path can be specified at construction
project/
โโ templates/
Template use PHP syntax and values are sanitized by default
<h1><?= $title ?></h1>
This project is licensed under the MIT License