Html.lua: Difference between revisions
No edit summary |
|||
Line 59: | Line 59: | ||
==form.longtext == | ==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="" } | |||
--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 == | ==form.passwd == |
Revision as of 18:43, 30 November 2007
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="" } --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.