Module:Data: Difference between revisions

Jump to navigation Jump to search
imported>Jackmcbarn
(redo how this works completely)
imported>MusikAnimal
m (Protected Module:Data: Highly visible template ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite)))
(No difference)

Revision as of 01:14, 28 October 2014

Documentation for this module may be created at Module:Data/doc

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)