* zin: fix global to:xxx rendered twice times.
This commit is contained in:
@@ -98,7 +98,7 @@ class directive implements iDirective
|
||||
{
|
||||
foreach($data as $blockName => $blockChildren)
|
||||
{
|
||||
$node->add($blockChildren, $blockName);
|
||||
$node->addToBlock($blockName, $blockChildren);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,6 +291,12 @@ class node implements \JsonSerializable
|
||||
|
||||
if($child instanceof node) $child->parent = $this;
|
||||
|
||||
if($child instanceof node)
|
||||
{
|
||||
if(isset($child->parent)) skipRenderInGlobal($child);
|
||||
$child->parent = $this;
|
||||
}
|
||||
|
||||
if($name === 'children' && $child instanceof node)
|
||||
{
|
||||
$blockName = static::getNameFromBlockMap($child->fullType());
|
||||
|
||||
@@ -39,8 +39,8 @@ require_once __DIR__ . DS . 'jquery.class.php';
|
||||
*/
|
||||
function to(string $blockName, mixed ...$args): directive
|
||||
{
|
||||
$node = new node(...$args);
|
||||
return directive('block', array($blockName => $node));
|
||||
skipRenderInGlobal($args);
|
||||
return directive('block', array($blockName => $args));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user