mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 03:14: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
|
15/11/2010
|
||||||
- bugfix when using {$smarty.session} as object
|
- bugfix when using {$smarty.session} as object
|
||||||
- bugfix scoping problem on $smarty object passed to filters
|
- 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
|
14/11/2010
|
||||||
- bugfix isset() did not allow multiple parameter
|
- bugfix isset() did not allow multiple parameter
|
||||||
|
@@ -223,7 +223,7 @@ class Smarty extends Smarty_Internal_Data {
|
|||||||
// default modifier
|
// default modifier
|
||||||
public $default_modifiers = array();
|
public $default_modifiers = array();
|
||||||
// global internal smarty vars
|
// global internal smarty vars
|
||||||
public $_smarty_vars = array();
|
static $_smarty_vars = array();
|
||||||
// start time for execution time calculation
|
// start time for execution time calculation
|
||||||
public $start_time = 0;
|
public $start_time = 0;
|
||||||
// default file permissions
|
// 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">
|
<!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">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
@@ -73,7 +73,7 @@ class Smarty_Internal_Compile_CaptureClose extends Smarty_Internal_CompileBase {
|
|||||||
if (isset($append)) {
|
if (isset($append)) {
|
||||||
$_output .= " \$_smarty_tpl->append($append, ob_get_contents());";
|
$_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;
|
return $_output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -31,7 +31,7 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C
|
|||||||
case 'section':
|
case 'section':
|
||||||
return "\$_smarty_tpl->getVariable('smarty')->value$parameter";
|
return "\$_smarty_tpl->getVariable('smarty')->value$parameter";
|
||||||
case 'capture':
|
case 'capture':
|
||||||
return "\$_smarty_tpl->smarty->_smarty_vars$parameter";
|
return "Smarty::\$_smarty_vars$parameter";
|
||||||
case 'now':
|
case 'now':
|
||||||
return 'time()';
|
return 'time()';
|
||||||
case 'cookies':
|
case 'cookies':
|
||||||
|
@@ -69,6 +69,7 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
public $smarty = null;
|
public $smarty = null;
|
||||||
// blocks for template inheritance
|
// blocks for template inheritance
|
||||||
public $block_data = array();
|
public $block_data = array();
|
||||||
|
public $wrapper = null;
|
||||||
/**
|
/**
|
||||||
* Create template data object
|
* Create template data object
|
||||||
*
|
*
|
||||||
@@ -964,6 +965,13 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
return $this->$property_name = $args[0];
|
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
|
// pass call to Smarty object
|
||||||
return call_user_func_array(array($this->smarty,$name),$args);
|
return call_user_func_array(array($this->smarty,$name),$args);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user