Core Docs

DocumentShell.php

DocumentShell.php



Description


Config-driven HTML document shell. Generates opening/closing HTML around app content, auto-injecting core.assets stylesheets (standards, ui, layouts) and ui.js when assetDomain is set. Config set at construction, overridable per-call. All attribute output XSS-escaped via htmlspecialchars.

Classes


  • DocumentShell (final) — the shell builder

Functions/Methods


  • __construct(array $config) — merge config over defaults

  • open(array $config): string — doctype → <body>, injects asset links

  • close(array $config): string — bodyBottom snippets + </body></html>

  • render(string $content, array $config): string — open + content + close

  • mergeConfig(array $config): array — private, merge + filter empty entries

  • escape(string $value): string — private, htmlspecialchars wrapper

Includes/Dependencies


  • None (pure PHP, no imports)

Notes


  • Default assetDomain: https://core.assets.medkronos.com

  • head / bodyTop / bodyBottom accept arrays of raw HTML snippets (imploded unescaped — caller's responsibility)

  • Full option table + usage example: core.backend index