Files
order/app/helpers.php
T
Ty Clifford 34ca1be9b7 - Implemented the dark photo-based theme.
Moved all images to public/assets/images.
Added darkened photography across heroes, specials, menu cards, 
authentication, story, checkout, and footer.
Replaced placeholder branding with the supplied logo.
Preserved configurable menu item images.
Updated desktop and mobile styling for readable cream/gold text.
2026-06-10 16:11:29 -04:00

67 lines
1.5 KiB
PHP

<?php
declare(strict_types=1);
use FatBottom\Core\Security;
function e(mixed $value): string
{
return htmlspecialchars((string) $value, ENT_QUOTES, 'UTF-8');
}
function money(int|string|null $cents): string
{
return '$' . number_format(((int) $cents) / 100, 2);
}
function csrf_field(): string
{
return '<input type="hidden" name="_token" value="' . e(Security::csrfToken()) . '">';
}
function active_path(string $path): string
{
$current = \FatBottom\Core\Http::path();
return $current === $path ? 'is-active' : '';
}
function url(string $path = '/'): string
{
return \FatBottom\Core\Http::url($path);
}
function asset(string $path): string
{
return \FatBottom\Core\Http::url('/' . ltrim($path, '/'));
}
function selected(mixed $value, mixed $expected): string
{
return (string) $value === (string) $expected ? 'selected' : '';
}
function checked(mixed $value): string
{
return (bool) $value ? 'checked' : '';
}
function store_datetime(?string $value, string $format = 'M j, Y g:i A'): string
{
if ($value === null || $value === '') {
return '';
}
$date = new DateTimeImmutable($value, new DateTimeZone('UTC'));
return $date->setTimezone(new DateTimeZone(date_default_timezone_get()))->format($format);
}
function utc_datetime(?string $value): ?string
{
if ($value === null || trim($value) === '') {
return null;
}
$date = new DateTimeImmutable($value, new DateTimeZone(date_default_timezone_get()));
return $date->setTimezone(new DateTimeZone('UTC'))->format('Y-m-d H:i:s');
}