Module:Params/doc: Difference between revisions

Content deleted Content added
mNo edit summary
Nomenclature: functions "merge_and_call" and "merge_and_invoke" have been renamed to "concat_and_call" and "concat_and_invoke"
Line 72:
If no arguments are passed the vertical bar (<code>&#124;</code>) will be used as parameter separator, with no header and no footer.
 
=== <code>merge_and_callconcat_and_call</code> ===
; Brief
: Prepends user-given unnamed arguments to the current parameters, or impose user-given named arguments; then propagate everything to a custom template
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|merge_and_callconcat_and_call|template name|[prepend 1]|[prepend 2]|[...]|[prepend n]|[named item 1=value 1]|[...]|[named item n=value n]|[...]
}}</syntaxhighlight>
 
For example, if our <code><nowiki>{{Example template}}</nowiki></code> had the following code,
 
<syntaxhighlight lang="wikitext">{{#invoke:params|merge_and_callconcat_and_call|foo bar|elbow|earth|room|7=classy|hello=not today}}</syntaxhighlight>
 
and it were called with,
Line 93:
If no other argument besides the template name are provided this function simply echoes the current parameters to another template.
 
=== <code>merge_and_invokeconcat_and_invoke</code> ===
; Brief
: Prepends user-given unnamed arguments to the current parameters, or impose user-given named arguments; then propagate everything to a custom module
; Syntax
: <syntaxhighlight lang="wikitext" inline>{{#invoke:params|merge_and_invokeconcat_and_invoke|module name|function name|[prepend 1]|[prepend 2]|[...]|[prepend n]|[named item 1=value 1]|[...]|[named item n=value n]|[...]
}}</syntaxhighlight>
 
Exactly like [[#merge_and_callconcat_and_call|<code>merge_and_callconcat_and_call</code>]], but invokes a module instead of calling a template.
 
=== <code>call_for_each</code> ===