- Added an event manager. Also, fixed some more bugs within Block and Section tokens

This commit is contained in:
mcndave committed 2023-01-26 13:32:52 +00:00
1 parent 58f73d914b
commit 08211282c2
14 files changed
+164 -18

No files matched your search

+5 -3
View File
@@ -49,7 +49,9 @@ class BlockToken implements ControlStructure {
$def = end($slotDefinitions);
list($name, $definition) = array_pad(explode(',', $arguments, 2), 2, "");
$loops = count($context->iterationStack ?? []) ? ",". implode(', ', array_filter(array_column($context->iterationStack, 'uid'), fn($e) => strpos($e, '[') === false)) : null;
if ($def->hasDefinitions() ) {
$slotName = eval("return $name;");
$def->currentSlot = $slotName;
@@ -62,7 +64,7 @@ class BlockToken implements ControlStructure {
}
return <<<PHP
<?php \$this->printSlot($name, function($definition array \$___using = []) use (\$picea) { extract(\$___using, \EXTR_SKIP); ?>
<?php \$this->printSlot($name, function($definition array \$___using = []) use (\$picea $loops) { extract(\$___using, \EXTR_SKIP); ?>
PHP;
}
else {
@@ -71,7 +73,7 @@ class BlockToken implements ControlStructure {
}
return <<<PHP
<?php (\$___block ?? \$this)->slotIsSet($name) || \$___block->setSlot($name, function($definition array \$___using = []) use (\$picea) { extract(\$___using, \EXTR_SKIP); ?>
<?php (\$___block ?? \$this)->slotIsSet($name) || \$___block->setSlot($name, function($definition array \$___using = []) use (\$picea $loops) { extract(\$___using, \EXTR_SKIP); ?>
PHP;
}