From 10e9e7039ed7a87f9b7ee8dc080bd6a6b55356ee Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Thu, 28 May 2020 08:58:33 +0200 Subject: [PATCH] add common config settings to template variables --- daux/d3processor.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/daux/d3processor.php b/daux/d3processor.php index 8e0f991..0a4ddbb 100644 --- a/daux/d3processor.php +++ b/daux/d3processor.php @@ -134,6 +134,14 @@ class d3DocumentRenderer implements BlockRendererInterface $daux->initializeConfiguration(); $params = $daux->getParams(); + + foreach ($params as $varname => $varvalue) { + if (false == is_array($varvalue)) { + $pattern = '/{\$'.$varname.'}/mU'; + $wholeDoc = preg_replace($pattern, $varvalue, $wholeDoc); + } + } + if (isset($params['variables'])) { $variables = $params['variables']; if (isset($variables) && is_array($variables) && count($variables)) {