Files
BattleForge/src/Views/match-stub.php
T

29 lines
869 B
PHP

<?php
declare(strict_types=1);
use BattleForge\Http\Escape;
/**
* @var string $csrf Provided by the front controller.
* @var ?string $matchJson The match:current JSON from localStorage, encoded as a string.
* Null if no match is in progress.
*/
$e = static fn (string $v): string => Escape::html($v);
$matchInfo = $matchJson !== null ? "Match loaded." : "No match in progress.";
?><?php
render_layout(static function () use ($e, $matchInfo, $matchJson): void {
?>
<h1>Match</h1>
<p><?= $e($matchInfo) ?></p>
<?php if ($matchJson !== null) : ?>
<details>
<summary>Match state (debug)</summary>
<pre><?= $e($matchJson) ?></pre>
</details>
<?php endif; ?>
<p>Battle interface coming in Plan 4.</p>
<p><a href="/">Back to home</a></p>
<?php
}, $csrf, 'Match');