Initial commit

This commit is contained in:
2022-11-15 09:23:20 +01:00
commit 22127b8702
13 changed files with 369 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
<?php
declare(strict_types=1);
namespace Silex\Http;
class HttpResponse
{
private int $status;
private string $viewPath;
private array $viewParams;
public function __construct(int $status, string $viewPath, array $viewParams = [])
{
$this->status = $status;
$this->viewPath = $viewPath;
$this->viewParams = $viewParams;
}
public function render(string $viewBasePath)
{
$params = $this->viewParams;
ob_start();
require $viewBasePath . '/' . $this->viewPath . '.php';
$content = ob_get_clean();
require $viewBasePath . '/layout.php';
}
}