make separate var for compiler file

This commit is contained in:
mohrt
2003-01-28 15:05:13 +00:00
parent 89ef1e5b08
commit e8fb7091d2
3 changed files with 18 additions and 8 deletions

View File

@@ -152,8 +152,8 @@ class Smarty
var $left_delimiter = '{'; // template tag delimiters.
var $right_delimiter = '}';
var $compiler_class = 'Smarty_Compiler'; // the compiler class used by
// Smarty to compile templates
var $compiler_file = 'Smarty_Compiler.class.php'; // the compiler filename
var $compiler_class = 'Smarty_Compiler'; // the compiler class
var $config_class = 'Config_File'; // the config class used by
// Smarty to load config vars
@@ -1122,7 +1122,12 @@ function _generate_debug_output() {
\*======================================================================*/
function _compile_template($tpl_file, $template_source, &$template_compiled)
{
require_once SMARTY_DIR.$this->compiler_class . '.class.php';
if(file_exists(SMARTY_DIR.$this->compiler_file)) {
require_once SMARTY_DIR.$this->compiler_file;
} else {
// use include_path
require_once $this->compiler_file;
}
$smarty_compiler = new $this->compiler_class;

View File

@@ -1979,7 +1979,7 @@ $smarty->display("file:F:/path/to/my/templates/menu.tpl");
// from PHP script
// put these function somewhere in your application
function db_get_template ($tpl_name, &tpl_source, &$smarty_obj)
function db_get_template ($tpl_name, &$tpl_source, &$smarty_obj)
{
// do database call here to fetch your template,
// populating $tpl_source
@@ -1995,7 +1995,7 @@ function db_get_template ($tpl_name, &tpl_source, &$smarty_obj)
}
}
function db_get_timestamp($tpl_name, &$tpl_timestamp, &$smarty_obj)
function db_get_timestamp($tpl_name, &$tpl_timestamp, &$smarty_obj)
{
// do database call here to populate $tpl_timestamp.
$sql = new SQL;

View File

@@ -152,8 +152,8 @@ class Smarty
var $left_delimiter = '{'; // template tag delimiters.
var $right_delimiter = '}';
var $compiler_class = 'Smarty_Compiler'; // the compiler class used by
// Smarty to compile templates
var $compiler_file = 'Smarty_Compiler.class.php'; // the compiler filename
var $compiler_class = 'Smarty_Compiler'; // the compiler class
var $config_class = 'Config_File'; // the config class used by
// Smarty to load config vars
@@ -1122,7 +1122,12 @@ function _generate_debug_output() {
\*======================================================================*/
function _compile_template($tpl_file, $template_source, &$template_compiled)
{
require_once SMARTY_DIR.$this->compiler_class . '.class.php';
if(file_exists(SMARTY_DIR.$this->compiler_file)) {
require_once SMARTY_DIR.$this->compiler_file;
} else {
// use include_path
require_once $this->compiler_file;
}
$smarty_compiler = new $this->compiler_class;