diff options
Diffstat (limited to 'misc/render_template.php')
| -rw-r--r-- | misc/render_template.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/misc/render_template.php b/misc/render_template.php index 1ee349d..294fc16 100644 --- a/misc/render_template.php +++ b/misc/render_template.php @@ -35,8 +35,11 @@ function render_template(string $templateName, array $args = []) { } function call_template(string $templateName, array $args = [], callable $slotContent = null) { global $__spooky_magical_template_global_state; + // note to self: yes this does actually clone the array + $__spooky_magical_template_global_state['previousState'] = $__spooky_magical_template_global_state; $__spooky_magical_template_global_state['slotContent'] = $slotContent; render_template($templateName, $args); + $__spooky_magical_template_global_state = $__spooky_magical_template_global_state['previousState']; } } |
