Jump to content

Module:Params/doc/examples/check for unknown parameters/doc: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
mNo edit summary
Update the documentation
 
Line 1: Line 1:
This example template shows to use {{mfl|params|with_name_not_matching|...}} to check for unknown parameters.
This example template shows to use {{mfl|params|discarding|...}} to check for unknown parameters.


== Usage ==
== Usage ==

Latest revision as of 19:31, 26 September 2024

This example template shows to use {{#invoke:params|discarding|...}} to check for unknown parameters.

Usage

[edit]

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: