Template:Foreach: Difference between revisions
Jump to navigation
Jump to search
(stealing this from MediaWiki's wiki) |
(rewriting Foreach to take named parameters item_in, up_to, and call) |
||
Line 1: | Line 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
-->{{# | -->{{#ifexpr:{{{up_to}}}>0|{{{{{call}}}|{{#explode:{{{item_in}}}|,|1}}}}}}<!-- | ||
-->{{#ifexpr:{{{up_to}}}>1|{{{{{call}}}|{{#explode:{{{item_in}}}|,|2}}}}}}<!-- | |||
-->{{#ifexpr:{{{up_to}}}>2|{{{{{call}}}|{{#explode:{{{item_in}}}|,|3}}}}}}<!-- | |||
-->{{# | -->{{#ifexpr:{{{up_to}}}>3|{{{{{call}}}|{{#explode:{{{item_in}}}|,|4}}}}}}<!-- | ||
-->{{#ifexpr:{{{up_to}}}>4|{{{{{call}}}|{{#explode:{{{item_in}}}|,|5}}}}}}<!-- | |||
-->{{#ifexpr:{{{up_to}}}>5|{{{{{call}}}|{{#explode:{{{item_in}}}|,|6}}}}}}<!-- | |||
-->{{# | -->{{#ifexpr:{{{up_to}}}>6|{{{{{call}}}|{{#explode:{{{item_in}}}|,|7}}}}}}<!-- | ||
-->{{#ifexpr:{{{up_to}}}>7|{{{{{call}}}|{{#explode:{{{item_in}}}|,|8}}}}}}<!-- | |||
-->{{# | -->{{#ifexpr:{{{up_to}}}>8|{{{{{call}}}|{{#explode:{{{item_in}}}|,|9}}}}}}<!-- | ||
-->{{#ifexpr:{{{up_to}}}>9|{{{{{call}}}|{{#explode:{{{item_in}}}|,|10}}}}}}<!-- | |||
-->{{# | -->{{#ifexpr:{{{up_to}}}>10|{{{{{call}}}|{{#explode:{{{item_in}}}|,|11}}}}}}<!-- | ||
-->{{#ifexpr:{{{up_to}}}>11|{{{{{call}}}|{{#explode:{{{item_in}}}|,|12}}}}}}<!-- | |||
-->{{# | -->{{#ifexpr:{{{up_to}}}>12|{{{{{call}}}|{{#explode:{{{item_in}}}|,|13}}}}}}</includeonly><noinclude> | ||
-->{{# | |||
-->{{# | |||
-->{{# | |||
-->{{# | |||
-->{{# | |||
-->{{# | |||
-->{{# | |||
Handles a list of arguments separated by a specified delimiter (an optional parameter named "delim"). | Handles a list of arguments separated by a specified delimiter (an optional parameter named "delim"). | ||
[[Category:Macro templates]] | [[Category:Macro templates]] | ||
</noinclude> | </noinclude> |
Revision as of 15:51, 10 December 2015
Handles a list of arguments separated by a specified delimiter (an optional parameter named "delim").