Module:IndianPremierLeague/GroupStageTable
Revision as of 05:38, 7 April 2014 by blackwiki>Jfd34 (isLimitedOvers = true)
local _module = {}
_module.create = function(frame)
local args = frame.args
local year = tonumber(args.year) or error("Parameter: 'year' is missing or invalid")
local teams = {}
do
-- Get the team objects for the given teams
local i = 1
local teamTable = mw.loadData("Module:IndianPremierLeague/Teams")
for t in mw.text.gsplit(args.teams or error("Missing parameter: 'teams'"), '%s*,%s*') do
local teamObj = teamTable[t]
if not teamObj or year < teamObj.startYear or (teamObj.endYear and teamObj.endYear < year) then
error("Team '" .. t .. "' does not exist or is not valid for the given year.")
end
teams[i] = teamObj
i = i + 1
end
end
return require("Module:CricketLeagueGroupStageSummary").create(year .. " IPL Group Stage Table", teams, args.useParentData and frame:getParent().args or args, true, nil, args.useWebSlice)
end
return _module