Module:TestMod: Difference between revisions

From Hazeron Wiki
Jump to navigation Jump to search
(testing arg returns)
(ok so apparently you can't just get the args directly and you need to use a "frame")
Line 1: Line 1:
local p = {} --p stands for package
local p = {} --p stands for package


function p.hello( arg )
function p.hello( frame )
     return arg
local args = frame:getParent().args
local templateArgs = frame.args
     return args
end
end


return p
return p

Revision as of 12:18, 17 April 2024

Basic test Lua module, can be invoked with {{#invoke: TestMod|FunctionName|arg1|arg2|etc ...}}


local p = {} --p stands for package

function p.hello( frame )
	local args = frame:getParent().args
	local templateArgs = frame.args
    return args
end

return p