mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
- bugfix captured content could not be accessed globally
- bugfix Smarty2 wrapper functions could not be call from within plugins
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
15/11/2010
|
||||
- bugfix when using {$smarty.session} as object
|
||||
- bugfix scoping problem on $smarty object passed to filters
|
||||
- bugfix captured content could not be accessed globally
|
||||
- bugfix Smarty2 wrapper functions could not be call from within plugins
|
||||
|
||||
14/11/2010
|
||||
- bugfix isset() did not allow multiple parameter
|
||||
|
@@ -223,7 +223,7 @@ class Smarty extends Smarty_Internal_Data {
|
||||
// default modifier
|
||||
public $default_modifiers = array();
|
||||
// global internal smarty vars
|
||||
public $_smarty_vars = array();
|
||||
static $_smarty_vars = array();
|
||||
// start time for execution time calculation
|
||||
public $start_time = 0;
|
||||
// default file permissions
|
||||
|
@@ -1,4 +1,4 @@
|
||||
{capture assign=debug_output}
|
||||
{capture name='_smarty_debug' assign=debug_output}
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head>
|
||||
|
@@ -73,7 +73,7 @@ class Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase {
|
||||
if (isset($append)) {
|
||||
$_output .= " \$_smarty_tpl->append($append, ob_get_contents());";
|
||||
}
|
||||
$_output .= " \$_smarty_tpl->smarty->_smarty_vars['capture'][$buffer]=ob_get_clean();?>";
|
||||
$_output .= " Smarty::\$_smarty_vars['capture'][$buffer]=ob_get_clean();?>";
|
||||
return $_output;
|
||||
}
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C
|
||||
case 'section':
|
||||
return "\$_smarty_tpl->getVariable('smarty')->value$parameter";
|
||||
case 'capture':
|
||||
return "\$_smarty_tpl->smarty->_smarty_vars$parameter";
|
||||
return "Smarty::\$_smarty_vars$parameter";
|
||||
case 'now':
|
||||
return 'time()';
|
||||
case 'cookies':
|
||||
|
@@ -69,6 +69,7 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
||||
public $smarty = null;
|
||||
// blocks for template inheritance
|
||||
public $block_data = array();
|
||||
public $wrapper = null;
|
||||
/**
|
||||
* Create template data object
|
||||
*
|
||||
@@ -964,6 +965,13 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
||||
return $this->$property_name = $args[0];
|
||||
}
|
||||
}
|
||||
// Smarty Backward Compatible wrapper
|
||||
if (strpos($name,'_') !== false) {
|
||||
if (!isset($this->wrapper)) {
|
||||
$this->wrapper = new Smarty_Internal_Wrapper($this);
|
||||
}
|
||||
return $this->wrapper->convert($name, $args);
|
||||
}
|
||||
// pass call to Smarty object
|
||||
return call_user_func_array(array($this->smarty,$name),$args);
|
||||
}
|
||||
|
Reference in New Issue
Block a user