Module:Params/doc/examples/check for unknown parameters/doc: Difference between revisions
From Kenshi Wiki
More actions
Created page with "This example template shows to use {{mfl|params|discarding|...}} to check for unknown parameters. == Usage == For instance, writing <syntaxhighlight lang="wikitext">{{module:params/doc/examples/check for unknown parameters | hello = world | wind = surfing }}</syntaxhighlight> will generate : {{module:params/doc/examples/check for unknown parameters | hello = world | wind = surfing }} while writing <syntaxhighlight lang="wikitext">{{module:params/doc/examples/ch..." |
No edit summary |
||
Line 47: | Line 47: | ||
[[Category:Module documents]] | [[Category:Module documents]] | ||
[[Category:Module misc documents]] | [[Category:Module misc documents]] | ||
</noinclude> | </noinclude> |
Revision as of 06:51, 9 March 2025
This example template shows to use {{#invoke:params|discarding|...}} to check for unknown parameters.
Usage
For instance, writing
{{module:params/doc/examples/check for unknown parameters
| hello = world
| wind = surfing
}}
will generate
- Everything is good: do something
while writing
{{module:params/doc/examples/check for unknown parameters
| hello = world
| wind = surfing
| wrong = ups!
}}
will generate
- Error: The only parameters accepted are
|hello=
and|wind=
.
For simple cases like this specialized modules are available; you might want to have a look at:
- {{#invoke:Check for unknown parameters|check}}
- {{#invoke:Check for deprecated parameters|check}}
- {{#invoke:Check for clobbered parameters|check}}
- {{#invoke:Parameter validation|validateparams}}
- {{#invoke:TemplatePar|valid}}