mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
make separate var for compiler file
This commit is contained in:
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
||||
|
Reference in New Issue
Block a user