Implement simple PHP based view renderer

This commit is contained in:
Tim
2023-08-15 03:02:55 +02:00
parent 9b8985640c
commit c80dcd2860
9 changed files with 83 additions and 9 deletions

View File

@ -14,6 +14,7 @@ use Ardent\Undercurrent\Http\RouterInterface;
use Ardent\Undercurrent\Http\StatusEnum;
use Ardent\Undercurrent\Logger\LogContainer;
use Ardent\Undercurrent\Logger\LoggerInterface;
use Ardent\Undercurrent\View\ViewInterface;
class BaseKernel
{
@ -61,10 +62,6 @@ class BaseKernel
//$response = $container->get(RouterConfig::class)->getExceptionRoute()->getController()::exception($e);
}
foreach ($log->getLogs() as $log) {
echo sprintf('<p>%s</p>', $log);
}
http_response_code($response->getStatus()->value);
foreach ($response->getHeaders() as $header) {
@ -72,6 +69,10 @@ class BaseKernel
}
echo $response->getBody();
foreach ($log->getLogs() as $log) {
echo sprintf('<p>%s</p>', $log);
}
}
protected function addControllers(ContainerInterface $container, array $controllers): void