getCookieParams();
$orders = [];
if (isset($cookies['order']) && $cookies['order'] !== '') {
$orders = explode(',', $cookies['order']);
}
if (count($orders) > 0) {
$orderList = '
';
foreach ($orders as $order) {
$orderList .= '- ' . htmlspecialchars($order) . '
';
}
$orderList .= '
';
$message = 'ごちそうさまでした。
';
} else {
$orderList = '';
$message = '注文がありません。
';
}
$body = <<
いただきます
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));
}
}