Jump to content

Module:ShowArguments

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Salix alba (talk | contribs) at 08:29, 16 July 2013 (better). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
--[[
ShowArguments
 
Displays all the arguments passed into the module 
Usage:
    {{ Invoke:ShowArguments | display }}
/*
*/

]]

local ShowArguments = {}

function ShowArguments.display(frame)
    local text='';
    globalFrame = frame
    local args = frame.args
    if args[1] == nil then
        text = 'Arguments from parent'
        local pFrame = frame:getParent();
        args = pFrame.args;
        for k,v in pairs( frame.args ) do
            args[k] = v;
        end
    end
        for k,v in pairs( frame.args ) do
             text = text .. 'key (' .. k .. ') value ('.. v .. ')';
        end
    return text
end
 
return ShowArguments