From 67094790d2d9db5c99e7c136f49061a78698e57d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 24 Nov 2025 04:58:38 +0900 Subject: Add vhosts/t/phpcon-kagawa-2025/ --- .../src/PhpConKagawa2025/CookieEatHandler.php | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 vhosts/t/phpcon-kagawa-2025/src/PhpConKagawa2025/CookieEatHandler.php (limited to 'vhosts/t/phpcon-kagawa-2025/src/PhpConKagawa2025/CookieEatHandler.php') diff --git a/vhosts/t/phpcon-kagawa-2025/src/PhpConKagawa2025/CookieEatHandler.php b/vhosts/t/phpcon-kagawa-2025/src/PhpConKagawa2025/CookieEatHandler.php new file mode 100644 index 0000000..93e9c3b --- /dev/null +++ b/vhosts/t/phpcon-kagawa-2025/src/PhpConKagawa2025/CookieEatHandler.php @@ -0,0 +1,66 @@ +getCookieParams(); + + $orders = []; + if (isset($cookies['order']) && $cookies['order'] !== '') { + $orders = explode(',', $cookies['order']); + } + + if (count($orders) > 0) { + $orderList = ''; + $message = '

ごちそうさまでした。

'; + } else { + $orderList = ''; + $message = '

注文がありません。

'; + } + + $body = << + + + + + いただきます + + +
+

いただきます

+ {$orderList} + {$message} + もう一度注文する +
+ + +HTML; + + return $this->responseFactory->createResponse(200) + ->withHeader('Content-Type', 'text/html; charset=UTF-8') + ->withHeader('Set-Cookie', 'order=; Max-Age=0; path=/') + ->withBody($this->streamFactory->createStream($body)); + } +} -- cgit v1.2.3-70-g09d2