Zum Inhalt springen

„Wikipedia:Lua/Modul/Hello/en“ – Versionsunterschied

aus Wikipedia, der freien Enzyklopädie
Inhalt gelöscht Inhalt hinzugefügt
Setup
 
update
Zeile 1: Zeile 1:
{{LuaModuleDoc}}
{{Wikipedia:Lua/Modul-Navigation|Hello|3|lang:de=1|lang:en=1}}
'''<code>Hello</code>''' – module for demonstration of [[Lua]] usage within a Wiki-project.
'''<code>Hello</code>''' – module for demonstration of [[Lua]] usage within a Wiki-project.



Version vom 24. April 2013, 21:48 Uhr

Vorlagenprogrammierung Diskussionen Lua Test Unterseiten
Modul Deutsch English

Modul: Dokumentation

Hello – module for demonstration of Lua usage within a Wiki-project.

Functions for templates

hello
Returns a string like Hello, world! This is Lua!
  • 1(optional) name of the recipient
    • Default: world

Syntax example

For templates this means:

  • without parameter: {{#invoke:Hello|hello}}
    • yields: Hallo, Welt! Dies ist Lua!
  • with parameter: {{#invoke:Hello|hello|John Doe}}
    • yields: Hallo, John Doe! Dies ist Lua!

Functions for Lua modules

(None which could be called via require)

Local implementation

hello(frame)
Returns the string.
frame – Call environment
  • frame.args[ 1 ] – Passed first unnamed parameter: name of the recipient

Dependencies

(No other module required)

Usage

Any test scenario.

Origin

en:Module:Bananas and others.