Difference between revisions of "Module:Arguments"
Jump to navigation
Jump to search
(Created page with "local p = {} function p.getArgs(frame, options) options = options or {} local metatable = {} function metatable:__index(key) local arg = frame.args[key] ...") |
(No difference)
|
Revision as of 04:59, 9 April 2017
local p = {}
function p.getArgs(frame, options)
options = options or {} local metatable = {} function metatable:__index(key) local arg = frame.args[key] if arg == nil and options.inherited then local parent = frame:getParent() arg = parent and parent.args[key] or nil end return arg end return setmetatable({}, metatable)
end
return p