<?php
function e($s) { return htmlspecialchars((string)$s, ENT_QUOTES, 'UTF-8'); }

function redirect(string $path) {
    header('Location: ' . $path);
    exit;
}

function render(string $view, array $params = []) {
    extract($params);
    require __DIR__ . '/views/layout/header.php';
    require __DIR__ . '/views/' . $view . '.php';
    require __DIR__ . '/views/layout/footer.php';
}

function now_ymd() { return date('Y-m-d'); }
