Geen bewerkingssamenvatting |
Geen bewerkingssamenvatting |
||
| Regel 26: | Regel 26: | ||
-- frame:extensionTag( name, content, args ) | -- frame:extensionTag( name, content, args ) | ||
local tag = 'input' | local tag = 'input' | ||
local inputcontent = frame. | local inputcontent = frame.args.content or "Test" | ||
-- args | -- args | ||
local inputtype = frame.args.type or "" | local inputtype = frame.args.type or "" | ||
Versie van 21 sep 2023 14:42
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=
}}
Please log in first.
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.input= function(frame)
-- frame:extensionTag( name, content, args )
local tag = 'input'
local inputcontent = frame.args.content or "Test"
-- args
local inputtype = frame.args.type or ""
local inputvalue = frame.args.value or ""
local inputid = frame.args.id or ""
local args = { id = inputid, type = inputtype, value = inputvalue, class = 'form-control' }
local str = frame:extensionTag( tag, inputcontent, args )
return str
end
return p
