feat: add battlefield editor GET and POST handlers

This commit is contained in:
Keith Solomon
2026-07-06 22:05:47 -05:00
parent 12b1547fac
commit 7cb670b512
4 changed files with 196 additions and 0 deletions
@@ -0,0 +1,27 @@
<?php
declare(strict_types=1);
namespace BattleForge\Http\Handlers;
use BattleForge\Http\Request;
use BattleForge\Http\Response;
final class GetBattlefieldEditor
{
/** @param array<string, string> $params */
public function handle(Request $request, array $params): Response
{
$csrf = $request->cookies['__csrf'] ?? '';
$scenarioId = $params['id'] ?? 'new';
$width = 8;
$height = 8;
ob_start();
require_once __DIR__ . '/../../Views/layout.php';
require __DIR__ . '/../../Views/battlefield-editor.php';
$body = (string) ob_get_clean();
return Response::html(200, $body);
}
}