Skip to main content
Zailaja
Build. Route. Render. Own the stack.
Home
Projects
Systems
Contact
Login
ZUI Layout Spine Editor
ZUI Layout Spine Editor
Whitelisted test tree: /home2/zailaja0/physicality/apps_private/zailaja/pages/guest/layout_spine_test
Validate JSON
Format JSON
Refresh Viewer
Save All Panels
Config
Settings JSON
Views
layout.php
Partials
partials/head.php
partials/css_variables.php
partials/header.php
partials/nav.php
partials/footer.php
partials/scripts.php
partials/flash.php
partials/admin_toolbar.php
Pages
pages/home.php
pages/admin/settings.php
Assets
assets/css/app.css
Ready.
Settings JSON
config/zui_lab_settings.json
{ "site": { "name": "ZAILAJA", "tagline": "Layout Spine Test", "lang": "en", "base_url": "" }, "theme": { "name": "upscale-restaurant", "color_scheme": "dark", "accent": "#8f2f2f", "brand": "#c9a45c", "radius": "1rem", "density": "spacious" }, "layout": { "compact": false, "show_admin_toolbar": true }, "nav": [ { "label": "Home", "href": "/" }, { "label": "Settings", "href": "/admin/settings" } ], "footer": { "copyright": "© 2026 ZAILAJA", "disclaimer": "Layout spine test environment." } }
<?php declare(strict_types=1); /** * ZUI Layout Spine * * Expected: * $page = [ * 'title' => '', * 'description' => '', * 'view' => 'home.php', * 'body_class' => '', * 'content' => [], * 'css' => '', * 'js' => '', * ]; * * $settings = normalized app settings array. */ $page = $page ?? []; $settings = $settings ?? []; if (!function_exists('e')) { function e(mixed $value): string { return htmlspecialchars((string) $value, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); } } $view = (string)($page['view'] ?? 'home.php'); $view = ltrim($view, '/'); $viewPath = __DIR__ . '/pages/' . $view; if (!is_file($viewPath)) { $viewPath = __DIR__ . '/pages/home.php'; } ?><!doctype html> <html lang="<?= e($settings['site']['lang'] ?? 'en') ?>"> <head> <?php require __DIR__ . '/partials/head.php'; ?> </head> <body class="<?= e($page['body_class'] ?? '') ?>"> <a class="skip-link" href="#main-content">Skip to main content</a> <?php require __DIR__ . '/partials/admin_toolbar.php'; ?> <?php require __DIR__ . '/partials/header.php'; ?> <?php require __DIR__ . '/partials/flash.php'; ?> <main id="main-content" class="site-main"> <?php require $viewPath; ?> </main> <?php require __DIR__ . '/partials/footer.php'; ?> <?php require __DIR__ . '/partials/scripts.php'; ?> </body> </html>
<?php $title = trim((string)($page['title'] ?? '')); $siteName = (string)($settings['site']['name'] ?? 'ZAILAJA'); if ($title === '') { $title = $siteName; } elseif (!str_contains($title, '|')) { $title .= ' | ' . $siteName; } $description = (string)($page['description'] ?? ''); $canonical = (string)($page['canonical'] ?? ''); $robots = (string)($page['robots'] ?? 'index, follow'); ?> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title><?= e($title) ?></title> <?php if ($description !== ''): ?> <meta name="description" content="<?= e($description) ?>"> <?php endif; ?> <?php if ($canonical !== ''): ?> <link rel="canonical" href="<?= e($canonical) ?>"> <?php endif; ?> <meta name="robots" content="<?= e($robots) ?>"> <meta name="color-scheme" content="<?= e($settings['theme']['color_scheme'] ?? 'dark') ?>"> <?php require __DIR__ . '/css_variables.php'; ?> <link rel="stylesheet" href="/assets/css/app.css"> <?php if (!empty($page['css'])): ?> <style id="page-css"> <?= (string)$page['css'] ?> </style> <?php endif; ?>
<style id="zui-settings-variables"> :root { --zui-brand: <?= e($settings['theme']['brand'] ?? '#c9a45c') ?>; --zui-accent: <?= e($settings['theme']['accent'] ?? '#8f2f2f') ?>; --zui-radius: <?= e($settings['theme']['radius'] ?? '1rem') ?>; --zui-density: <?= !empty($settings['layout']['compact']) ? '0.85' : '1' ?>; --zui-canvas: #090706; --zui-surface: #120f0d; --zui-ink: #f8efe2; --zui-muted: #b9a58c; --zui-line: rgba(201, 164, 92, 0.28); } </style>
<header class="site-header"> <a class="site-brand" href="/"> <strong><?= e($settings['site']['name'] ?? 'ZAILAJA') ?></strong> <?php if (!empty($settings['site']['tagline'])): ?> <small><?= e($settings['site']['tagline']) ?></small> <?php endif; ?> </a> <?php require __DIR__ . '/nav.php'; ?> </header>
<?php $navItems = is_array($settings['nav'] ?? null) ? $settings['nav'] : []; ?> <nav class="site-nav" aria-label="Primary navigation"> <?php foreach ($navItems as $item): ?> <?php $label = (string)($item['label'] ?? ''); $href = (string)($item['href'] ?? '#'); if ($label === '') { continue; } ?> <a href="<?= e($href) ?>"><?= e($label) ?></a> <?php endforeach; ?> </nav>
<footer class="site-footer"> <div> <strong><?= e($settings['site']['name'] ?? 'ZAILAJA') ?></strong> <p><?= e($settings['footer']['copyright'] ?? '') ?></p> </div> <?php if (!empty($settings['footer']['disclaimer'])): ?> <p class="muted"><?= e($settings['footer']['disclaimer']) ?></p> <?php endif; ?> </footer>
<script> (() => { document.documentElement.dataset.zuiReady = '1'; })(); </script> <?php if (!empty($page['js'])): ?> <script id="page-js"> <?= (string)$page['js'] ?> </script> <?php endif; ?>
<?php if (!empty($page['flash'])): ?> <aside class="flash" role="status"> <?= e($page['flash']) ?> </aside> <?php endif; ?>
<?php if (!empty($settings['layout']['show_admin_toolbar'])): ?> <div class="admin-toolbar"> <span>Admin</span> <a href="/admin/settings">Settings</a> <a href="/admin/layout-spine-editor.php">Layout Editor</a> </div> <?php endif; ?>
<section class="hero"> <p class="eyebrow"><?= e($page['content']['eyebrow'] ?? 'Layout Spine') ?></p> <h1><?= e($page['content']['heading'] ?? 'Reusable PHP layout powered by settings') ?></h1> <p><?= e($page['content']['body'] ?? 'This page is rendered through layout.php and partials.') ?></p> <a class="button" href="/admin/settings">Open Settings</a> </section>
<section class="section"> <h1><?= e($page['content']['heading'] ?? 'Settings') ?></h1> <p class="muted">This page is where the settings renderer will be mounted.</p> <?php if (!empty($page['content']['settings_html'])): ?> <?= (string)$page['content']['settings_html'] ?> <?php endif; ?> </section>
*, *::before, *::after { box-sizing: border-box; } html, body { min-height: 100%; margin: 0; } body { background: var(--zui-canvas); color: var(--zui-ink); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.6; } a { color: inherit; } .skip-link { position: absolute; left: 1rem; top: 1rem; transform: translateY(-150%); background: var(--zui-brand); color: #090706; padding: 0.5rem 0.75rem; border-radius: 999px; } .skip-link:focus { transform: translateY(0); } .admin-toolbar { display: flex; gap: 0.75rem; align-items: center; padding: 0.5rem 1rem; background: #000; color: var(--zui-muted); font-size: 0.85rem; } .site-header, .site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: calc(1rem * var(--zui-density)) clamp(1rem, 4vw, 3rem); border-block: 1px solid var(--zui-line); background: var(--zui-surface); } .site-brand { display: grid; color: inherit; text-decoration: none; } .site-brand small, .muted { color: var(--zui-muted); } .site-nav { display: flex; flex-wrap: wrap; gap: 1rem; } .site-nav a { color: var(--zui-muted); text-decoration: none; } .site-nav a:hover { color: var(--zui-brand); } .site-main { min-height: 70vh; } .hero, .section { padding: clamp(3rem, 9vw, 8rem) clamp(1rem, 5vw, 4rem); } .hero { min-height: 70vh; display: grid; place-content: center; text-align: center; } .eyebrow { color: var(--zui-brand); letter-spacing: 0.18em; text-transform: uppercase; font-weight: 800; } h1 { max-width: 12ch; margin: 0 auto; font-size: clamp(3rem, 8vw, 7rem); line-height: 0.95; } p { max-width: 64ch; } .button { width: fit-content; margin-inline: auto; display: inline-flex; padding: 0.85rem 1.25rem; border-radius: 999px; background: var(--zui-brand); color: #090706; text-decoration: none; font-weight: 800; } .flash { margin: 1rem; padding: 1rem; border-radius: var(--zui-radius); border: 1px solid var(--zui-line); background: rgba(201, 164, 92, 0.12); }
Viewer
Source / JSON tree