Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:GetParameters/doc: Difference between revisions

From Poets.Wiki
No edit summary
No edit summary
Line 16: Line 16:


== See also ==
== See also ==
* [[Module:Arguments]]
* Module:Arguments


<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |

Revision as of 17:08, 6 April 2025

This page uses Creative Commons Licensed content from Wikipedia (view authors).

Template:High use

Usage

getParameters

Takes 2 required arguments, frame_args and arg_list. Parses a frame's arguments, returning either the provided named arguments in arg_list if found or the positional parameters instead if not. This is designed to work around the stripping of values that takes place for defined parameters which could be important.

As an example, the calls getParameters({"a", "b", "c"}, {"x", "y"}) and getParameters({x="a", y="b", z="c"}, {"x", "y"}) would both give back {x="a", y="b"}.

getBoolean

Takes 1 required argument boolean_str. Turns the input into a true/false boolean value based on the input. Will error if given anything other than a string or boolean value.

defined

To be invoked from inside a template instead of a module. Determines if a certain parameter is defined in the parent frame's arguments.

See also

  • Module:Arguments