Vorlagenprogrammierung | Diskussionen | Lua | Test | Unterseiten | |||
Modul | Deutsch | English
|
Modul: | Dokumentation |
Hello
– module for demonstration of Lua usage within a Wiki-project.
Functions for templates
Bearbeiten- hello
- Returns a string like
Hello, world! This is Lua!
1
– (optional) name of the recipient- Default:
world
- Default:
Syntax example
BearbeitenFor templates this means:
- without parameter:
{{#invoke:Hello|hello}}
- yields:
Hallo, Welt! Dies ist Lua!
- yields:
- with parameter:
{{#invoke:Hello|hello|John Doe}}
- yields:
Hallo, John Doe! Dies ist Lua!
- yields:
Functions for Lua modules
Bearbeiten(None which could be called via require)
Local implementation
Bearbeiten- hello(frame)
- Returns the string.
frame
– Call environmentframe.args[ 1 ]
– Passed first unnamed parameter: name of the recipient
Dependencies
Bearbeiten(No other module required)
Usage
BearbeitenAny test scenario.
Origin
Bearbeitenen:Module:Bananas (2012/2013), meanwhile like en:Module:Example.