Jump to content

Module:User:SuggestBot/WikiProjects

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Nettrom (talk | contribs) at 16:46, 4 August 2015 (gah, args). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local wp = {}

local function has_key(tbl, key)
	return tbl[key] ~= nil	
end

function wp.hello(frame)
	return "Hello World!"	
end

function wp.test_args(frame)
	result = "The method got the following arguments:"
	if has_key(frame, 'is_included') then
		result = result .. "\n* is_included" .. frame.args['is_included']
	end
	for k, v in pairs(frame.args) do
		result = result .. "\n* " .. k .. "=" .. v				
	end
	return result
end

return wp