mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
- use $template_class property for template class name when compiling {include},{eval} and {extends} tags
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
- removed direct access to constants in templates because of some syntax problems
|
- removed direct access to constants in templates because of some syntax problems
|
||||||
- removed cache resource plugin for mysql from the distribution
|
- removed cache resource plugin for mysql from the distribution
|
||||||
- replaced most hard errors (exceptions) by softerrors(trigger_error) in plugins
|
- replaced most hard errors (exceptions) by softerrors(trigger_error) in plugins
|
||||||
|
- use $template_class property for template class name when compiling {include},{eval} and {extends} tags
|
||||||
|
|
||||||
11/30/2009
|
11/30/2009
|
||||||
- map 'true' to SMARTY_CACHING_LIFETIME_CURRENT for the $smarty->caching parameter
|
- map 'true' to SMARTY_CACHING_LIFETIME_CURRENT for the $smarty->caching parameter
|
||||||
|
@@ -32,7 +32,7 @@ class Smarty_Internal_Compile_Eval extends Smarty_Internal_CompileBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create template object
|
// create template object
|
||||||
$_output = "\$_template = new Smarty_Template ('string:'.".$_attr['var'].", \$_smarty_tpl->smarty, \$_smarty_tpl);";
|
$_output = "\$_template = new {$compiler->smarty->template_class}('string:'.".$_attr['var'].", \$_smarty_tpl->smarty, \$_smarty_tpl);";
|
||||||
//was there an assign attribute?
|
//was there an assign attribute?
|
||||||
if (isset($_assign)) {
|
if (isset($_assign)) {
|
||||||
$_output .= "\$_smarty_tpl->assign($_assign,\$_template->getRenderedTemplate());";
|
$_output .= "\$_smarty_tpl->assign($_assign,\$_template->getRenderedTemplate());";
|
||||||
|
@@ -31,7 +31,7 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase {
|
|||||||
// $include_file = '';
|
// $include_file = '';
|
||||||
eval('$include_file = ' . $_attr['file'] . ';');
|
eval('$include_file = ' . $_attr['file'] . ';');
|
||||||
// create template object
|
// create template object
|
||||||
$_template = new Smarty_Template ($include_file, $this->smarty, $compiler->template);
|
$_template = new $compiler->smarty->template_class($include_file, $this->smarty, $compiler->template);
|
||||||
// save file dependency
|
// save file dependency
|
||||||
$compiler->template->properties['file_dependency']['F' . abs(crc32($_template->getTemplateFilepath()))] = array($_template->getTemplateFilepath(), $_template->getTemplateTimestamp());
|
$compiler->template->properties['file_dependency']['F' . abs(crc32($_template->getTemplateFilepath()))] = array($_template->getTemplateFilepath(), $_template->getTemplateTimestamp());
|
||||||
$_old_source = $compiler->template->template_source;
|
$_old_source = $compiler->template->template_source;
|
||||||
|
@@ -34,7 +34,7 @@ class Smarty_Internal_Compile_Function_Call extends Smarty_Internal_CompileBase
|
|||||||
}
|
}
|
||||||
$_name = trim($_attr['name'], "'");
|
$_name = trim($_attr['name'], "'");
|
||||||
// create template object
|
// create template object
|
||||||
$_output = "<?php \$_template = new Smarty_Template ('string:', \$_smarty_tpl->smarty, \$_smarty_tpl);\n";
|
$_output = "<?php \$_template = new {$compiler->smarty->template_class} ('string:', \$_smarty_tpl->smarty, \$_smarty_tpl);\n";
|
||||||
// assign default paramter
|
// assign default paramter
|
||||||
if (isset($this->smarty->template_functions[$_name]['parameter'])) {
|
if (isset($this->smarty->template_functions[$_name]['parameter'])) {
|
||||||
// function is already compiled
|
// function is already compiled
|
||||||
|
@@ -132,7 +132,7 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// create template object
|
// create template object
|
||||||
$_output = "<?php \$_template = new Smarty_Template ($include_file, \$_smarty_tpl->smarty, \$_smarty_tpl, \$_smarty_tpl->cache_id, \$_smarty_tpl->compile_id, $_caching, $_cache_lifetime);";
|
$_output = "<?php \$_template = new {$compiler->smarty->template_class} ($include_file, \$_smarty_tpl->smarty, \$_smarty_tpl, \$_smarty_tpl->cache_id, \$_smarty_tpl->compile_id, $_caching, $_cache_lifetime);";
|
||||||
// delete {include} standard attributes
|
// delete {include} standard attributes
|
||||||
unset($_attr['file'], $_attr['assign'], $_attr['cache_lifetime'], $_attr['nocache'], $_attr['caching'], $_attr['scope']);
|
unset($_attr['file'], $_attr['assign'], $_attr['cache_lifetime'], $_attr['nocache'], $_attr['caching'], $_attr['scope']);
|
||||||
// remaining attributes must be assigned as smarty variable
|
// remaining attributes must be assigned as smarty variable
|
||||||
|
Reference in New Issue
Block a user