function.configvalue.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2020 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of the MIT License.
7  *
8  * See the LICENSE file distributed with this work for
9  * additional information.
10  */
12 
13 /**
14  * Output a configuration value.
15  *
16  * Example:
17  * @code
18  * {configvalue key="exportDir" section="cms"}
19  * @endcode
20  *
21  * @param $params Array with keys:
22  * - key: The key in the configuration section
23  * - section: The name of the configuration section
24  * @param $template Smarty_Internal_Template
25  * @return String
26  */
27 function smarty_function_configvalue(array $params, Smarty_Internal_Template $template) {
28  $config = ObjectFactory::getInstance('configuration');
29  echo $config->getValue($params['key'], $params['section']);
30 }
31 ?>
ObjectFactory implements the service locator pattern by wrapping a Factory instance and providing sta...