Jump to content

Module:Data

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Jackmcbarn (talk | contribs) at 20:57, 13 March 2014 (create helper module to get values from a data module). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

local p = {}

function p.main(frame)
	local data
	for k, v in ipairs(frame.args) do
		if k == 1 then
			data = mw.loadData('Module:' .. v)
		else
			data = data[v]
		end
	end
	return data
end

return p