Regel 37: Regel 37:
 
local args = { id = inputid, type = inputtype, value = inputvalue, class = inputclass }
 
local args = { id = inputid, type = inputtype, value = inputvalue, class = inputclass }
 
 
local str = frame:extensionTag(
+
local str = frame:extensionTag( tag, 'Some content here', args )
tag,
 
'Some content here',
 
args
 
)
 
 
return str
 
return str
 
end
 
end
Regel 47: Regel 43:
 
p.inputtest = function(frame)
 
p.inputtest = function(frame)
 
local tag = '_input'
 
local tag = '_input'
local str = frame:extensionTag( tag, 'Some text here', { name = 'foo', type = 'textarea' } )
+
local args = { name = 'foo', type = 'textarea' }
 +
local str = frame:extensionTag( tag, 'Some text here', args )
 
return str
 
return str
 
end
 
end
  
 
return p
 
return p

Versie van 21 sep 2023 19:36

Module:FF




invoke within form

{{#invoke:FF|input 
|type=text 
|name=myname
|value=Value here 
|id=fff-443434 
|class=form-control

|label=Name
|template=Data item

|slot=
|param=
|template=
}}


Getdata

Kikkers en tongzoenen - Sarah Mlynowski (2007), 1ᵉ druk, Uitgeverij Van Goor Unieboek BV, Houten:

Scriptfout: de functie "getdata" bestaat niet.

Works with parser function though


Titel/-787178247

getdatatest

Scriptfout: de functie "getdatatest" bestaat niet.


local p = {}

p.form1 = function(frame)
	-- test of frame:callParserFunction
	-- {{#tag:form||id=bla|action=get}}
	local content = 'Test'
	local formparams = { 'form', content, id = 'bla', action = 'get' }
	local str = frame:callParserFunction( '#tag', formparams )
	return str
end

--[[
Makes more sense than using callParserFunction
but "equivalent to a call to frame:callParserFunction() with function name '#tag' "
]]--
p.form2 = function(frame)
	-- frame:extensionTag( name, content, args )
	local content = 'Test'
	local tag = 'form'
	local args = { id = 'bla', action = 'get' }
	local str = frame:extensionTag( tag, content, args )
	return str
end

p.input2 = function(frame)
	-- frame:extensionTag( name, content, args )
	local tag = '_input'
	local content = frame.args.text or ""
	local inputtype = frame.args.type or ""
	local inputname = frame.args.name or ""
	local inputvalue = frame.args.value or ""
	local inputid = frame.args.id or ""
	local inputclass = frame.args.class or ""

	local args = {}
	--foreach here so we don't get empty attr
	local args = { id = inputid, type = inputtype, value = inputvalue, class = inputclass }
	
	local str = frame:extensionTag( tag, 'Some content here', args )
	return str
end

p.inputtest = function(frame)
	local tag = '_input'
	local args = { name = 'foo', type = 'textarea' }
	local str = frame:extensionTag( tag, 'Some text here', args )
	return str
end

return p