Jump to content

Module:ShowArguments: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
ShowArguments
better
Line 6: Line 6:
{{ Invoke:ShowArguments | display }}
{{ Invoke:ShowArguments | display }}
/*
/*
*/

]]

local ShowArguments = {}

function ShowArguments.display(frame)
local text='';
globalFrame = frame
globalFrame = frame
local args = frame.args
local args = frame.args
Line 19: Line 27:
text = text .. 'key (' .. k .. ') value ('.. v .. ')';
text = text .. 'key (' .. k .. ') value ('.. v .. ')';
end
end
*/

]]

local ShowArguments = {}

function ShowArguments.display(frame)
local text='foobar';
return text
return text
end
end

Revision as of 08:29, 16 July 2013

--[[
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