Module:Data
Jump to navigation
Jump to search
![]() | This Lua module is used on approximately 130,000 pages. To avoid large-scale disruption and unnecessary server load, any changes to it should first be tested in the module's /sandbox or /testcases subpages. The tested changes can then be added to this page in a single edit. Please consider discussing changes on the talk page before implementing them. |
![]() | This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing. |
This module allows wikitext to read values from data modules.
Usage[edit source]
{{#invoke:Data|Module:ModuleName|key1|key2|key3|...}}
Read data value key1.key2.key3 from Module:ModuleName.
External links[edit source]
- Module:Data at Wikipedia, the free Terran-based encyclopedia that anyone can edit.
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)