%s', htmlspecialchars($component_name), htmlspecialchars(json_encode($args), ENT_QUOTES, 'UTF-8'), $slot_content ); } return sprintf( '
', htmlspecialchars($component_name), htmlspecialchars(json_encode($args), ENT_QUOTES, 'UTF-8') ); } /** * Get JQHTML template metadata by component ID * * @param string $template_id Component name (e.g., 'Counter_Widget') * @return array|null Template file metadata from manifest, or null if not found */ public static function get_jqhtml_template_by_id(string $template_id): ?array { $manifest = Manifest::get_full_manifest(); // Look up component in jqhtml index if (!isset($manifest['data']['jqhtml']['components'][$template_id])) { // INTENTIONAL DEVIATION: Return null for missing template instead of throwing exception // This allows callers to gracefully handle missing components return null; } $component = $manifest['data']['jqhtml']['components'][$template_id]; // Get template file path if (!isset($component['template_file'])) { shouldnt_happen("JQHTML component '{$template_id}' has no template_file in manifest"); } $template_file = $component['template_file']; // Get full file metadata if (!isset($manifest['data']['files'][$template_file])) { shouldnt_happen("JQHTML template file '{$template_file}' for component '{$template_id}' not found in manifest files"); } return $manifest['data']['files'][$template_file]; } }