Jump to content

Module:Sandbox/Certes

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Certes (talk | contribs) at 01:29, 28 April 2018 (Random page in category test). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local p = {}

-- Entry point for Lua callers
function p._test(frame)
	local text = frame:expandTemplate{ title = "Random page in category", args = {"Countries in Africa"} }
	return text
end

-- Entry point for template callers using #invoke:
function p.test(frame)
	-- args = { nothing yet }
	local args = frame.args -- from calling module
	local pargs = frame:getParent().args -- from template
	return p._test(frame) -- (args[1] or pargs[1], args[2] or pargs[2])
end

return p