create-prisma-php-app 3.3.10 → 3.3.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -408,23 +408,23 @@ class TemplateCompiler
|
|
|
408
408
|
string $componentName,
|
|
409
409
|
array $incomingProps
|
|
410
410
|
): string {
|
|
411
|
-
$mapping
|
|
412
|
-
$instance
|
|
411
|
+
$mapping = self::selectComponentMapping($componentName);
|
|
412
|
+
$instance = self::initializeComponentInstance($mapping, $incomingProps);
|
|
413
413
|
|
|
414
414
|
$childHtml = '';
|
|
415
415
|
foreach ($node->childNodes as $c) {
|
|
416
416
|
$childHtml .= self::processNode($c);
|
|
417
417
|
}
|
|
418
418
|
|
|
419
|
-
$instance->children = $childHtml;
|
|
419
|
+
$instance->children = trim($childHtml);
|
|
420
420
|
|
|
421
|
-
$baseId
|
|
422
|
-
$idx
|
|
421
|
+
$baseId = 's' . base_convert(sprintf('%u', crc32($mapping['className'])), 10, 36);
|
|
422
|
+
$idx = self::$componentInstanceCounts[$baseId] ?? 0;
|
|
423
423
|
self::$componentInstanceCounts[$baseId] = $idx + 1;
|
|
424
424
|
$sectionId = $idx === 0 ? $baseId : "{$baseId}{$idx}";
|
|
425
425
|
|
|
426
|
-
$html
|
|
427
|
-
$fragDom
|
|
426
|
+
$html = $instance->render();
|
|
427
|
+
$fragDom = self::convertToXml($html);
|
|
428
428
|
$root = $fragDom->documentElement;
|
|
429
429
|
foreach ($root->childNodes as $c) {
|
|
430
430
|
if ($c instanceof DOMElement) {
|