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 defaultsopen(array $config): string— doctype →<body>, injects asset linksclose(array $config): string— bodyBottom snippets +</body></html>render(string $content, array $config): string— open + content + closemergeConfig(array $config): array— private, merge + filter empty entriesescape(string $value): string— private, htmlspecialchars wrapper
Includes/Dependencies
- None (pure PHP, no imports)
Notes
- Default
assetDomain:https://core.assets.medkronos.com head/bodyTop/bodyBottomaccept arrays of raw HTML snippets (imploded unescaped — caller's responsibility)- Full option table + usage example: core.backend index