模板:Module link expanded/doc
此頁面是Template:Module link expanded的模板文件。 此頁面可能包含了模板的使用說明、分類和其他內容。 |
此模板使用Lua語言: |
Template:Module link expanded(編輯 | 討論 | 歷史 | 連結 | 監視 | 日誌) (often abbreviated {{mlx}}) is used to display a module name as a link surrounded by braces with the {{#invoke}} parser function, thus showing the module name as code rather than actually invoking it. Its primary use is in instruction and documentation where it is used to refer to a module by name without invoking it. It is also supports the definition of a function and parameters.
Examples
編輯Code | Result | Notes |
---|---|---|
{{mlx |
{{#invoke:Example|function}}
|
Usage without function name. This does not produce a usable invocation. |
{{mlx |
{{#invoke:Example|hello}}
|
Usage with a function name. |
{{mlx |
{{#invoke:Example|count_fruits|bananas=5|apples=10}}
|
Usage with a function name and parameters. |
{{mlx |
{{#invoke:Example|count_fruits|bananas=5|apples=10}}
|
Usage with a function name and parameters, using {{=}}. |
TemplateData
編輯This template displays a module name as a link surrounded by braces with the {{#invoke}} parser function, thus showing how the module name would be used in code. Its primary use is in instruction and documentation.
參數 | 描述 | 類型 | 狀態 | |
---|---|---|---|---|
module name | 1 | the module name without the namespace prefix 「Module:」, which is added automatically | 字串 | 必填 |
function name | 2 | the function name within the module to call | 字串 | 必填 |
parameter 1 | 3 | the name (and value) of the first parameter, use {{=}} to add an equal sign | 字串 | 非必填 |
parameter 2 | 4 | the name (and value) of the second parameter, use {{=}} to add an equal sign | 字串 | 非必填 |
parameter 3 | 5 | the name (and value) of the third parameter, use {{=}} to add an equal sign | 字串 | 非必填 |
See also
編輯- {{ml}} – similar function but not surrounded in
<code>...</code>
tags - {{mfl}} – similar to {{ml}} but creates a link to the function's documentation
- {{tlx}} – a version of this template for templates instead of modules