Index: trunk/extensions/Loops/Loops.php |
— | — | @@ -201,6 +201,8 @@ |
202 | 202 | |
203 | 203 | /** |
204 | 204 | * #fornumargs: keyVarName | valVarName | code |
| 205 | + * or (since 0.4 for more consistency) |
| 206 | + * #fornumargs: | keyVarName | valVarName | code |
205 | 207 | */ |
206 | 208 | public static function pfObj_fornumargs( Parser &$parser, $frame, $args ) { |
207 | 209 | /* |
— | — | @@ -216,6 +218,12 @@ |
217 | 219 | } |
218 | 220 | ksort( $tNumArgs ); // sort from lowest to highest |
219 | 221 | |
| 222 | + if( count( $args ) > 3 ) { |
| 223 | + // compatbility to pre 0.4 but consistency with other Loop functions. |
| 224 | + // this way the first argument can be ommitted like '#fornumargs: |varKey |varVal |code' |
| 225 | + array_shift( $args ); |
| 226 | + } |
| 227 | + |
220 | 228 | return self::perform_forargs( $parser, $frame, $args, $tNumArgs, '' ); |
221 | 229 | } |
222 | 230 | |
Index: trunk/extensions/Loops/RELEASE-NOTES |
— | — | @@ -6,9 +6,11 @@ |
7 | 7 | counter, for example including an special page in wikitext. This has been solved now. |
8 | 8 | - Language file clean-up. |
9 | 9 | - Internal structure changed, ExtLoops now works as a static class. |
| 10 | + - '#fornumargs' parameter 1 can be empty to make it more consistent with other Loop parser |
| 11 | + functions. E.g. '{{#fornumargs: | keyVarName | valVarName | code }}' istead of |
| 12 | + '{{#fornumargs: keyVarName | valVarName | code }}' (which still works as well). |
10 | 13 | @ToDo: Open points for final 0.4 release: |
11 | 14 | - Compatbility to Variables Version 2.0. |
12 | | - - '#fornumargs' parameter 1 optional to make it more consistent with other functions. |
13 | 15 | |
14 | 16 | * November 15, 2011 -- Version 0.3.2 by Daniel Werner |
15 | 17 | - Bug solved where '#loop' didn't create variables with name or starting index '0'. |