, Bootstrap, sidebar y abre
. * Layout::close() cierra
, agrega scripts y . */ class Layout { // ─── Apertura ──────────────────────────────────────────────────────────── /** * Emite el HTML inicial de la página (head + sidebar + apertura de main). * * @param string $title Título de la pestaña y del encabezado. * @param string $icon Clase FontAwesome del ícono (ej. 'fas fa-ticket-alt'). */ public static function open(string $title = 'Panel', string $icon = 'fas fa-th-large'): void { $appName = defined('APP_NAME') ? APP_NAME : 'ERP System'; $safeTitle = htmlspecialchars($title, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); $safeIcon = htmlspecialchars($icon, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); // Exponer variables para sidebar.php $GLOBALS['_LAYOUT_TITLE'] = $title; $GLOBALS['_LAYOUT_ICON'] = $icon; // Detectar base URL (para assets relativos) $base = defined('APP_URL') ? rtrim(APP_URL, '/') : ''; ?> <?= $safeTitle ?> — <?= htmlspecialchars($appName, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') ?>