mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
Added $smarty.section.* syntax.
This commit is contained in:
1
NEWS
1
NEWS
@@ -1,3 +1,4 @@
|
||||
- added $smarty.section.* syntax for accessing section properties. (Andrei)
|
||||
- added custom cache handling function ability. (Monte)
|
||||
- added assign attribute to insert, fetch, math, and counter functions,
|
||||
documented. (Monte)
|
||||
|
@@ -1082,12 +1082,16 @@ class Smarty_Compiler extends Smarty {
|
||||
break;
|
||||
|
||||
case 'foreach':
|
||||
case 'section':
|
||||
if ($indexes[1]{0} != '.') {
|
||||
$this->_syntax_error('$smarty' . implode('', array_slice($indexes, 0, 2)) . ' is an invalid reference');
|
||||
}
|
||||
$name = substr($indexes[1], 1);
|
||||
array_shift($indexes);
|
||||
$compiled_ref = "\$this->_foreach['$name']";
|
||||
if ($ref == 'foreach')
|
||||
$compiled_ref = "\$this->_foreach['$name']";
|
||||
else
|
||||
$compiled_ref = "\$this->_sections['$name']";
|
||||
break;
|
||||
|
||||
/* These cases have to be handled at run-time. */
|
||||
|
@@ -1082,12 +1082,16 @@ class Smarty_Compiler extends Smarty {
|
||||
break;
|
||||
|
||||
case 'foreach':
|
||||
case 'section':
|
||||
if ($indexes[1]{0} != '.') {
|
||||
$this->_syntax_error('$smarty' . implode('', array_slice($indexes, 0, 2)) . ' is an invalid reference');
|
||||
}
|
||||
$name = substr($indexes[1], 1);
|
||||
array_shift($indexes);
|
||||
$compiled_ref = "\$this->_foreach['$name']";
|
||||
if ($ref == 'foreach')
|
||||
$compiled_ref = "\$this->_foreach['$name']";
|
||||
else
|
||||
$compiled_ref = "\$this->_sections['$name']";
|
||||
break;
|
||||
|
||||
/* These cases have to be handled at run-time. */
|
||||
|
Reference in New Issue
Block a user