Jump to content

Module:Data

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by MusikAnimal (talk | contribs) at 01:14, 28 October 2014 (Protected Module:Data: Highly visible template ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local mt = {}

function mt.__index(t, k)
	return function(frame)
		local data = mw.loadData(k)
		for _,v in ipairs(frame.args) do
			data = data[v]
		end
		return data
	end
end

return setmetatable({}, mt)