4 * Smarty Method GetConfigVars
6 * Smarty::getConfigVars() method
9 * @subpackage PluginsInternal
12 class Smarty_Internal_Method_GetConfigVars
15 * Valid for all objects
22 * Returns a single or all config variables
24 * @api Smarty::getConfigVars()
25 * @link http://www.smarty.net/docs/en/api.get.config.vars.tpl
27 * @param \Smarty_Internal_Data|\Smarty_Internal_Template|\Smarty $data
28 * @param string $varname variable name or null
29 * @param bool $search_parents include parent templates?
31 * @return mixed variable value or or array of variables
33 public function getConfigVars(Smarty_Internal_Data $data, $varname = null, $search_parents = true)
37 while ($_ptr !== null) {
38 if (isset($varname)) {
39 if (isset($_ptr->config_vars[ $varname ])) {
40 return $_ptr->config_vars[ $varname ];
43 $var_array = array_merge($_ptr->config_vars, $var_array);
45 // not found, try at parent
46 if ($search_parents) {
47 $_ptr = $_ptr->parent;
52 if (isset($varname)) {