mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-02 21:31:48 +01:00
- config_load method can now be called on data and template objects
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user