PhantomCaleb (talk | contribs) (+attach) |
PhantomCaleb (talk | contribs) mNo edit summary |
||
Line 12: | Line 12: | ||
function p.attach(cargoTable) |
function p.attach(cargoTable) |
||
return frame:callParserFunction{ |
return frame:callParserFunction{ |
||
− | name = '# |
+ | name = '#cargo_attach:_table=' .. cargoTable |
} |
} |
||
end |
end |
Revision as of 04:49, 5 November 2017
This module is a wrapper over mw.ext.cargo
. It also provides utilities for constructing queries.
Using this module instead of using mw.ext.cargo directly allows us to see via Special:WhatLinksHere what pages are running Cargo queries.
Lua error in Module:UtilsPage at line 14: attempt to call field 'allOf' (a nil value).
local p = {}
local cargo = mw.ext.cargo
local frame = mw.getCurrentFrame()
function p.declare(cargoTable, fields)
return frame:callParserFunction{
name = '#cargo_declare:_table=' .. cargoTable,
args = fields
}
end
function p.attach(cargoTable)
return frame:callParserFunction{
name = '#cargo_attach:_table=' .. cargoTable
}
end
function p.store(cargoTable, fields)
frame:callParserFunction{
name = '#cargo_store:_table=' .. cargoTable,
args = fields
}
end
return setmetatable(p, {__index=cargo})