mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
Added 'first' and 'last' section properties.
This commit is contained in:
12
NEWS
12
NEWS
@@ -1,9 +1,9 @@
|
||||
- split out compiling code to separate class for faster
|
||||
template execution time (Monte)
|
||||
- added unregister_modifier, documented (Monte)
|
||||
- added unregister_function, documented (Monte)
|
||||
- added fetch function, documented (Monte)
|
||||
- added math function, documented (Monte)
|
||||
- added 'first' and 'last' section properties. (Andrei)
|
||||
- split out compiling code to separate class for faster template execution
|
||||
time (Monte)
|
||||
- added and documented unregister_modifier() and unregister_function() API
|
||||
calls. (Monte)
|
||||
- added and documented 'fetch' and 'math' functions. (Monte)
|
||||
- added ability to index looped variables by section properties, e.g.
|
||||
$foo.index_prev/bar. (Andrei)
|
||||
- added index_prev and index_next section properties. (Andrei)
|
||||
|
@@ -491,6 +491,8 @@ function _compile_section_start($tag_args)
|
||||
$output .= "{$section_props}['rownum'] = {$section_props}['index'] + 1;\n";
|
||||
$output .= "{$section_props}['index_prev'] = {$section_props}['index'] - 1;\n";
|
||||
$output .= "{$section_props}['index_next'] = {$section_props}['index'] + 1;\n";
|
||||
$output .= "{$section_props}['first'] = ({$section_props}['index'] == 0);\n";
|
||||
$output .= "{$section_props}['last'] = ({$section_props}['index'] == {$section_props}['loop']-1);\n";
|
||||
|
||||
$output .= "?>";
|
||||
|
||||
|
@@ -491,6 +491,8 @@ function _compile_section_start($tag_args)
|
||||
$output .= "{$section_props}['rownum'] = {$section_props}['index'] + 1;\n";
|
||||
$output .= "{$section_props}['index_prev'] = {$section_props}['index'] - 1;\n";
|
||||
$output .= "{$section_props}['index_next'] = {$section_props}['index'] + 1;\n";
|
||||
$output .= "{$section_props}['first'] = ({$section_props}['index'] == 0);\n";
|
||||
$output .= "{$section_props}['last'] = ({$section_props}['index'] == {$section_props}['loop']-1);\n";
|
||||
|
||||
$output .= "?>";
|
||||
|
||||
|
Reference in New Issue
Block a user