Anonymous user
Module:Arguments/doc: Difference between revisions
From The Kodiak Republic Wiki
m
→Recommended practice: escape examples
(→Recommended practice: add some more) |
m (→Recommended practice: escape examples) |
||
Line 50:
</syntaxhighlight>
The way this is called from a template is <code><nowiki>{{#invoke:Example|main}}</nowiki></code> (optionally with some parameters like <code><nowiki>{{#invoke:Example|main|arg1=value1|arg2=value2}}</nowiki></code>), and the way this is called from a module is <syntaxhighlight lang=lua inline>require('Module:Example')._main({arg1 = 'value1', arg2 = value2, 'spaced arg3' = 'value3'})</syntaxhighlight>. What this second one does is construct a table with the arguments in it, then gives that table to the p._main(args) function, which uses it natively.
=== Multiple functions ===
|