mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-07 03:44:26 +02:00
- implemented $smarty.block.name.parent to access parent block content
- fixed smarty.class
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
03/26/2009
|
03/26/2009
|
||||||
- fixed parser not to create error on `word` in double quoted strings
|
- fixed parser not to create error on `word` in double quoted strings
|
||||||
- allow PHP array(...)
|
- allow PHP array(...)
|
||||||
|
- implemented $smarty.block.name.parent to access parent block content
|
||||||
|
- fixed smarty.class
|
||||||
|
|
||||||
|
|
||||||
03/23/2009
|
03/23/2009
|
||||||
- fixed {foreachelse} and {forelse} tags
|
- fixed {foreachelse} and {forelse} tags
|
||||||
|
@@ -406,7 +406,7 @@ class Smarty extends Smarty_Internal_TemplateBase {
|
|||||||
* @param string $code the error code
|
* @param string $code the error code
|
||||||
*/
|
*/
|
||||||
class SmartyException {
|
class SmartyException {
|
||||||
public function printException($e)
|
public static function printException($e)
|
||||||
{
|
{
|
||||||
echo "Code: " . $e->getCode() . "<br />Error: " . htmlentities($e->getMessage()) . "<br />"
|
echo "Code: " . $e->getCode() . "<br />Error: " . htmlentities($e->getMessage()) . "<br />"
|
||||||
. "File: " . $e->getFile() . "<br />"
|
. "File: " . $e->getFile() . "<br />"
|
||||||
|
@@ -83,7 +83,11 @@ class Smarty_Internal_Compile_Smarty extends Smarty_Internal_CompileBase {
|
|||||||
case 'global':
|
case 'global':
|
||||||
return "\$_smarty_tpl->smarty->getGlobalVariable($_index[1])->value";
|
return "\$_smarty_tpl->smarty->getGlobalVariable($_index[1])->value";
|
||||||
case 'block':
|
case 'block':
|
||||||
return "'".addcslashes($compiler->template->block_data[trim($_index[1],"'")]['source'],"'")."'";
|
if ($_index[2] == '\'parent\'') {
|
||||||
|
return "'" . addcslashes($compiler->template->block_data[trim($_index[1], "'")]['source'], "'") . "'";
|
||||||
|
} else {
|
||||||
|
return "''";
|
||||||
|
}
|
||||||
case 'ldelim':
|
case 'ldelim':
|
||||||
$_ldelim = $this->smarty->left_delimiter;
|
$_ldelim = $this->smarty->left_delimiter;
|
||||||
return "'$_ldelim'";
|
return "'$_ldelim'";
|
||||||
@@ -97,8 +101,8 @@ class Smarty_Internal_Compile_Smarty extends Smarty_Internal_CompileBase {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (isset($_index[1])) {
|
if (isset($_index[1])) {
|
||||||
$compiled_ref = $compiled_ref . "[$_index[1]]";
|
$compiled_ref = $compiled_ref . "[$_index[1]]";
|
||||||
}
|
}
|
||||||
return $compiled_ref;
|
return $compiled_ref;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user