From: Roland Haeder Date: Sun, 9 Feb 2014 00:59:05 +0000 (+0100) Subject: Added injectConfigVariables(), please do use with great causion. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ea6434f5921787482d0b61150252b614831058f5;p=core.git Added injectConfigVariables(), please do use with great causion. Signed-off-by: Roland Häder --- 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 *