Html.lua: Difference between revisions
No edit summary |
m (→link: nowiki'd a link to localhost.) |
||
(17 intermediate revisions by 3 users not shown) | |||
Line 3: | Line 3: | ||
== cookie.set == | |||
'''INPUT:'''<BR> | '''INPUT:'''<BR> | ||
This library required the following inputs/parameters. | This library required the following inputs/parameters. | ||
Line 15: | Line 15: | ||
-- Set variable/Call for this library | -- Set variable/Call for this library | ||
==html_escape == | |||
'''INPUT:'''<BR> | '''INPUT:'''<BR> | ||
This library required the following inputs/parameters. | This library required the following inputs/parameters. | ||
Line 29: | Line 29: | ||
This is > a test < string & | This is > a test < string & | ||
==nv_pair== | |||
'''INPUT:'''<BR> | '''INPUT:'''<BR> | ||
This library required the following inputs/parameters. | This library required the following inputs/parameters. | ||
Line 44: | Line 44: | ||
foo="bar" | foo="bar" | ||
==cfe_unpack == | |||
'''INPUT:'''<BR> | '''INPUT:'''<BR> | ||
This library required the following inputs/parameters. | This library required the following inputs/parameters. | ||
Line 57: | Line 57: | ||
<?= html.cfe(form) ?> | <?= html.cfe(form) ?> | ||
==form.longtext == | |||
'''INPUT:'''<BR> | |||
This library required the following inputs/parameters. | |||
*Needs a cfe table | |||
'''OUTPUT:'''<BR> | |||
This library deliverers the following output/parameters. | |||
*Html code for a <textarea> | |||
'''CODING EXAMPLE:''' | |||
-- Set variable/Call for this library | |||
--your model may return something like this | |||
return (cfe{value=status, name="inputarea", type="longtext", rows="30", cols="20" }) | |||
--your cfe will look something like this | |||
{ value=status, type="longtext", options="", errtxt="" , rows="30, cols="20"} | |||
--haserl code below. Used in views in ACF | |||
<? require "html" ?> | |||
<?= html.form[form.value.inputarea.type](form.value.inputarea) ?> | |||
--this way will only have to touch model/controller if change in code. Very rarely the view. | |||
==form.passwd == | |||
'''INPUT:'''<BR> | |||
This library required the following inputs/parameters. | |||
*Needs a cfe table | |||
'''OUTPUT:'''<BR> | |||
This library deliverers the following output/parameters. | |||
*Html code for a <input type=password> | |||
'''CODING EXAMPLE:''' | |||
-- Set variable/Call for this library | |||
--your model may return something like this | |||
return (cfe{value=status, name="inputarea", type="passwd" }) | |||
--your cfe will look something like this | |||
{ value=status, type="passwd", options="", errtxt="" } | |||
--haserl code below. Used in views in ACF | |||
<? require "html" ?> | |||
<?= html.form[form.value.inputarea.type](form.value.inputarea) ?> | |||
--this way will only have to touch model/controller if change in code. Very rarely the view. | |||
==form.hidden== | |||
'''INPUT:'''<BR> | |||
This library required the following inputs/parameters. | |||
*Needs a cfe table | |||
'''OUTPUT:'''<BR> | |||
This library deliverers the following output/parameters. | |||
*Html code for a <input type=hidden> | |||
'''CODING EXAMPLE:'' | |||
-- Set variable/Call for this library | |||
--your model may return something like this | |||
return (cfe{value=status, name="inputarea", type="hidden" }) | |||
--your cfe will look something like this | |||
{ value=status, type="hidden", options="", errtxt="" } | |||
--haserl code below. Used in views in ACF | |||
<? require "html" ?> | |||
<?= html.form[form.value.inputarea.type](form.value.inputarea) ?> | |||
--this way will only have to touch model/controller if change in code. Very rarely the view. | |||
==form.submit== | |||
'''INPUT:'''<BR> | |||
This library required the following inputs/parameters. | |||
*Needs a cfe table | |||
'''OUTPUT:'''<BR> | |||
This library deliverers the following output/parameters. | |||
*Html code for a <input type=submit> | |||
'''CODING EXAMPLE:''' | |||
-- Set variable/Call for this library | |||
--your model may return something like this | |||
return (cfe{value=status, name="inputarea", type="submit" }) | |||
--your cfe will look something like this | |||
{ value=status, type="submit", options="", errtxt="" } | |||
--haserl code below. Used in views in ACF | |||
<? require "html" ?> | |||
<?= html.form[form.value.inputarea.type](form.value.inputarea) ?> | |||
--this way will only have to touch model/controller if change in code. Very rarely the view. | |||
==form.action == | |||
'''INPUT:'''<BR> | |||
This library required the following inputs/parameters. | |||
*Needs a cfe table | |||
'''OUTPUT:'''<BR> | |||
This library deliverers the following output/parameters. | |||
*Html code for a <input type=submit> | |||
'''CODING EXAMPLE:''' | |||
-- Set variable/Call for this library | |||
--your model may return something like this | |||
return (cfe{value=status, name="inputarea", type="submit" }) | |||
--your cfe will look something like this | |||
{ value=status, type="submit", options="", errtxt="" } | |||
--haserl code below. Used in views in ACF | |||
<? require "html" ?> | |||
<?= html.form[form.value.inputarea.type](form.value.inputarea) ?> | |||
--this way will only have to touch model/controller if change in code. Very rarely the view. | |||
==form.file == | |||
'''INPUT:'''<BR> | |||
This library required the following inputs/parameters. | |||
*Needs a cfe table | |||
'''OUTPUT:'''<BR> | |||
This library deliverers the following output/parameters. | |||
*Html code for a <input type=file> | |||
'''CODING EXAMPLE:''' | |||
-- Set variable/Call for this library | |||
--your model may return something like this | |||
return (cfe{value=status, name="inputarea", type="file" }) | |||
--your cfe will look something like this | |||
{ value=status, type="file", options="", errtxt="" } | |||
--haserl code below. Used in views in ACF | |||
<? require "html" ?> | |||
<?= html.form[form.value.inputarea.type](form.value.inputarea) ?> | |||
--this way will only have to touch model/controller if change in code. Very rarely the view. | |||
==form.image== | |||
'''INPUT:'''<BR> | |||
This library required the following inputs/parameters. | |||
*Needs a cfe table | |||
'''OUTPUT:'''<BR> | |||
This library deliverers the following output/parameters. | |||
*Html code for a <input type=image> | |||
'''CODING EXAMPLE:''' | |||
-- Set variable/Call for this library | |||
--your model may return something like this | |||
return (cfe{value=status, name="inputarea", type="image" }) | |||
--your cfe will look something like this | |||
{ value=status, type="image", options="", errtxt="" } | |||
--haserl code below. Used in views in ACF | |||
<? require "html" ?> | |||
<?= html.form[form.value.inputarea.type](form.value.inputarea) ?> | |||
--this way will only have to touch model/controller if change in code. Very rarely the view. | |||
==form.select== | |||
'''INPUT:'''<BR> | |||
This library required the following inputs/parameters. | |||
*Needs a cfe table | |||
'''OUTPUT:'''<BR> | |||
This library deliverers the following output/parameters. | |||
*Html code for a <select> | |||
'''CODING EXAMPLE:''' | |||
-- Set variable/Call for this library | |||
--your model may return something like this | |||
return (cfe{value=status, name="inputarea", type="select" option= {"yes", "no", "maybe", "so" } }) | |||
--your cfe will look something like this | |||
{ value=status, type="select", options="", errtxt="" option= {"yes", "no", "maybe", "so"} } | |||
--haserl code below. Used in views in ACF | |||
<? require "html" ?> | |||
<?= html.form[form.value.inputarea.type](form.value.inputarea) ?> | |||
--this way will only have to touch model/controller if change in code. Very rarely the view. | |||
==form.checkbox== | |||
'''INPUT:'''<BR> | |||
This library required the following inputs/parameters. | |||
*Needs a cfe table | |||
'''OUTPUT:'''<BR> | |||
This library deliverers the following output/parameters. | |||
*Html code for a <input type=checkbox> | |||
'''CODING EXAMPLE:''' | |||
-- Set variable/Call for this library | |||
--your model may return something like this | |||
return (cfe{value=status, name="inputarea", type="checkbox" }) | |||
--your cfe will look something like this | |||
{ value=status, type="checkbox", options="", errtxt="" } | |||
--haserl code below. Used in views in ACF | |||
<? require "html" ?> | |||
<?= html.form[form.value.inputarea.type](form.value.inputarea) ?> | |||
--this way will only have to touch model/controller if change in code. Very rarely the view. | |||
==link== | |||
'''INPUT:'''<BR> | |||
This library required the following inputs/parameters. | |||
*A table | |||
'''OUTPUT:'''<BR> | |||
This library deliverers the following output/parameters. | |||
*Html code for a <input type=password> | |||
'''CODING EXAMPLE:''' | |||
-- Set variable/Call for this library | |||
--your model may return something like this | |||
url="<nowiki>http://localhost/cgi-bin/acf/</nowiki>" | |||
<? require "html" ?> | |||
<?= html.link{value = url .. varible.url, label="Download"}?> | |||
[[Category:Lua]] | |||
[[Category:ACF]] |
Latest revision as of 06:28, 29 July 2023
html.lua
This is used in the View section of the Model-Controller-View.
cookie.set
INPUT:
This library required the following inputs/parameters.
- name
- value
- path
OUTPUT:
This library deliverers the following output/parameters.
- String to set the cookie
CODING EXAMPLE:
-- Set variable/Call for this library
html_escape
INPUT:
This library required the following inputs/parameters.
- text-string
OUTPUT:
This library deliverers the following output/parameters.
- String with &,>,< signs encoded
CODING EXAMPLE:
-- Set variable/Call for this library bobo = require "html" format = bobo.html_escape("This is > a test < string &") print(format)
This is > a test < string &
nv_pair
INPUT:
This library required the following inputs/parameters.
- name
- value
OUTPUT:
This library deliverers the following output/parameters.
- name="value"
CODING EXAMPLE:
-- Set variable/Call for this library bobo = require "html" format = bobo.nv_pair("foo", "bar") print(format) foo="bar"
cfe_unpack
INPUT:
This library required the following inputs/parameters.
- Give a cfe table
OUTPUT:
This library deliverers the following output/parameters.
- String with the whole cfe table
CODING EXAMPLE:
-- Set variable/Call for this library --haserl code below. Used in views in ACF <? require "html ?>
<?= html.cfe(form) ?>
form.longtext
INPUT:
This library required the following inputs/parameters.
- Needs a cfe table
OUTPUT:
This library deliverers the following output/parameters.
- Html code for a <textarea>
CODING EXAMPLE:
-- Set variable/Call for this library --your model may return something like this return (cfe{value=status, name="inputarea", type="longtext", rows="30", cols="20" }) --your cfe will look something like this { value=status, type="longtext", options="", errtxt="" , rows="30, cols="20"} --haserl code below. Used in views in ACF <? require "html" ?> <?= html.form[form.value.inputarea.type](form.value.inputarea) ?> --this way will only have to touch model/controller if change in code. Very rarely the view.
form.passwd
INPUT:
This library required the following inputs/parameters.
- Needs a cfe table
OUTPUT:
This library deliverers the following output/parameters.
- Html code for a <input type=password>
CODING EXAMPLE:
-- Set variable/Call for this library --your model may return something like this return (cfe{value=status, name="inputarea", type="passwd" }) --your cfe will look something like this { value=status, type="passwd", options="", errtxt="" } --haserl code below. Used in views in ACF <? require "html" ?> <?= html.form[form.value.inputarea.type](form.value.inputarea) ?> --this way will only have to touch model/controller if change in code. Very rarely the view.
INPUT:
This library required the following inputs/parameters.
- Needs a cfe table
OUTPUT:
This library deliverers the following output/parameters.
- Html code for a <input type=hidden>
'CODING EXAMPLE:
-- Set variable/Call for this library --your model may return something like this return (cfe{value=status, name="inputarea", type="hidden" }) --your cfe will look something like this { value=status, type="hidden", options="", errtxt="" } --haserl code below. Used in views in ACF <? require "html" ?> <?= html.form[form.value.inputarea.type](form.value.inputarea) ?> --this way will only have to touch model/controller if change in code. Very rarely the view.
form.submit
INPUT:
This library required the following inputs/parameters.
- Needs a cfe table
OUTPUT:
This library deliverers the following output/parameters.
- Html code for a <input type=submit>
CODING EXAMPLE:
-- Set variable/Call for this library --your model may return something like this return (cfe{value=status, name="inputarea", type="submit" }) --your cfe will look something like this { value=status, type="submit", options="", errtxt="" } --haserl code below. Used in views in ACF <? require "html" ?> <?= html.form[form.value.inputarea.type](form.value.inputarea) ?> --this way will only have to touch model/controller if change in code. Very rarely the view.
form.action
INPUT:
This library required the following inputs/parameters.
- Needs a cfe table
OUTPUT:
This library deliverers the following output/parameters.
- Html code for a <input type=submit>
CODING EXAMPLE:
-- Set variable/Call for this library --your model may return something like this return (cfe{value=status, name="inputarea", type="submit" }) --your cfe will look something like this { value=status, type="submit", options="", errtxt="" } --haserl code below. Used in views in ACF <? require "html" ?> <?= html.form[form.value.inputarea.type](form.value.inputarea) ?> --this way will only have to touch model/controller if change in code. Very rarely the view.
form.file
INPUT:
This library required the following inputs/parameters.
- Needs a cfe table
OUTPUT:
This library deliverers the following output/parameters.
- Html code for a <input type=file>
CODING EXAMPLE:
-- Set variable/Call for this library --your model may return something like this return (cfe{value=status, name="inputarea", type="file" }) --your cfe will look something like this { value=status, type="file", options="", errtxt="" } --haserl code below. Used in views in ACF <? require "html" ?> <?= html.form[form.value.inputarea.type](form.value.inputarea) ?> --this way will only have to touch model/controller if change in code. Very rarely the view.
form.image
INPUT:
This library required the following inputs/parameters.
- Needs a cfe table
OUTPUT:
This library deliverers the following output/parameters.
- Html code for a <input type=image>
CODING EXAMPLE:
-- Set variable/Call for this library --your model may return something like this return (cfe{value=status, name="inputarea", type="image" }) --your cfe will look something like this { value=status, type="image", options="", errtxt="" } --haserl code below. Used in views in ACF <? require "html" ?> <?= html.form[form.value.inputarea.type](form.value.inputarea) ?> --this way will only have to touch model/controller if change in code. Very rarely the view.
form.select
INPUT:
This library required the following inputs/parameters.
- Needs a cfe table
OUTPUT:
This library deliverers the following output/parameters.
- Html code for a <select>
CODING EXAMPLE:
-- Set variable/Call for this library --your model may return something like this return (cfe{value=status, name="inputarea", type="select" option= {"yes", "no", "maybe", "so" } }) --your cfe will look something like this { value=status, type="select", options="", errtxt="" option= {"yes", "no", "maybe", "so"} } --haserl code below. Used in views in ACF <? require "html" ?> <?= html.form[form.value.inputarea.type](form.value.inputarea) ?> --this way will only have to touch model/controller if change in code. Very rarely the view.
form.checkbox
INPUT:
This library required the following inputs/parameters.
- Needs a cfe table
OUTPUT:
This library deliverers the following output/parameters.
- Html code for a <input type=checkbox>
CODING EXAMPLE:
-- Set variable/Call for this library --your model may return something like this return (cfe{value=status, name="inputarea", type="checkbox" }) --your cfe will look something like this { value=status, type="checkbox", options="", errtxt="" } --haserl code below. Used in views in ACF <? require "html" ?> <?= html.form[form.value.inputarea.type](form.value.inputarea) ?> --this way will only have to touch model/controller if change in code. Very rarely the view.
link
INPUT:
This library required the following inputs/parameters.
- A table
OUTPUT:
This library deliverers the following output/parameters.
- Html code for a <input type=password>
CODING EXAMPLE:
-- Set variable/Call for this library --your model may return something like this url="http://localhost/cgi-bin/acf/" <? require "html" ?> <?= html.link{value = url .. varible.url, label="Download"}?>