- config_load method can now be called on data and template objects

This commit is contained in:
Uwe.Tews
2009-11-05 18:22:40 +00:00
parent db0767a71e
commit 5c2b897534
4 changed files with 19 additions and 28 deletions

View File

@@ -200,6 +200,19 @@ class Smarty_Internal_TemplateBase {
$this->tpl_vars = array();
}
/**
* load a config file, optionally load just selected sections
*
* @param string $config_file filename
* @param mixed $sections array of section names, single section or null
*/
public function config_load($config_file, $sections = null)
{
// load Config class
$config = new Smarty_Internal_Config($config_file, $this->smarty);
$config->loadConfigVars($sections, $this);
}
/**
* gets the object of a Smarty variable
*

View File

@@ -1,27 +0,0 @@
<?php
/**
* Smarty methode Config_Load
*
* Loads a config file
*
* @package Smarty
* @subpackage Config
* @author Uwe Tews
*/
/**
* load a config file optionally load just selected sections
*
* @param object $smarty
* @param string $config_file filename
* @param mixed $sections array of section names, single section or null
*/
function Smarty_Method_Config_Load($smarty, $config_file, $sections = null)
{
// load Config class
$config = new Smarty_Internal_Config($config_file, $smarty);
$config->loadConfigVars($sections, $smarty);
}
?>