« Module:Essai » : différence entre les versions

De Adadov.net wiki
Aucun résumé des modifications
Aucun résumé des modifications
 
(Une version intermédiaire par le même utilisateur non affichée)
Ligne 4 : Ligne 4 :


function p.showType()  
function p.showType()  
local title = mw.title.getCurrentTitle()
local title = tostring(mw.title.getCurrentTitle())
if string.match(title, "doc") then
if string.match(title, "doc") then
p.type = "doc"
type = "doc"
else
else
p.type = "std"
type = "std"
end
end
p.type = type
return type
end
end



Dernière version du 4 février 2015 à 16:33

Documentation icon Documentation Module[voir] [éditer] [historique] [purger]

Test

local documentation = require('Module:Documentation').main

local p = {}

function p.showType() 
	local title = tostring(mw.title.getCurrentTitle())
	if string.match(title, "doc") then
		type = "doc"
	else
		type = "std"
	end
	
	p.type = type
	
	return type
end

function p.showTitle()
	print(tostring(mw.title.getCurrentTitle()))
end

return p