From ea6434f5921787482d0b61150252b614831058f5 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Sun, 9 Feb 2014 01:59:05 +0100 Subject: [PATCH] Added injectConfigVariables(), please do use with great causion. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../main/template/class_BaseTemplateEngine.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/inc/classes/main/template/class_BaseTemplateEngine.php b/inc/classes/main/template/class_BaseTemplateEngine.php index a47ce653..b0c73ee2 100644 --- a/inc/classes/main/template/class_BaseTemplateEngine.php +++ b/inc/classes/main/template/class_BaseTemplateEngine.php @@ -1194,6 +1194,21 @@ class BaseTemplateEngine extends BaseFrameworkSystem { $this->setVariable('config', $variableName, $this->getConfigInstance()->getConfigEntry($variableName)); } + /** + * Injects an array of config variables into the stack of currently loaded + * template. This method should only be used in very rare circumstances, + * e.g. when you have to copy a whole set of variables into the template + * engine. Before you use this method, please make sure you have considered + * all other possiblities. + * + * @param $variables An array with variables to be injected + * @return void + */ + public function injectConfigVariables (array $variables) { + // Set it + $this->varStack['config'] = $variables; + } + /** * Assigns all the application data with template variables * -- 2.39.5