Syntax

The main goal is to isolate the aspect of the overall form, by the configuration of single items of the form. The variable that is passed as first argument to Layout will hold all information on which are the widgets (graphical/input entieties) we want to display in the form.

methods

These methods are provided:

create: returns the html code needed to create the form
these options can be passed:

show
prints the code directly to the output
conf
allows to configure some aspects
tconf
allows to configure aspect of the cells in the table. with thismethod you can fine-tune the aspect of single cells. Eg.:
$class->tconf("e-name", "bgcolor=#ffffff", "class=my_look")
wconf
allows to configure the input widgets (data entries in html)Any html type can be configured via this method. Eg.: $class->wconf("c-name", "checked", "class=my_look")
see_var
a debugging method

General options ca be passed when creating the new instance of the class, via conf method or when shwo/create method is called.

description syntax

the creation of a widget is triggered by the presence of a 'namé, a modifier will force the type (default is input type).

first_name last_name
will be translated into a request to create a form w/ 2 widgets of type 'input', binded to name="first_name" and name="last_name".

A modifier can force the type to be any other type:

c=
a checkbox
r=
a radiobutton. The syntax for radiobutton will be: r=value/variable where variable is the 'name' connected to the element
p=
a password type
s=
a submit type
b=
a button
l=
a label
m=
a menu (select)
e=
an input type (default)

configuration of elements

the way to refer to an element, while configuring it is by using the string composed by modifier-name (NOTE: while defining you use modifier=name, the reason of this is lost... should you ask for it I could cosider to change it).

So if you want to add an onClick to an input type you just need to write:

$class->wconf("e-name","onclick=my_javascript")

Only exception is for radiobuttons that need a complete specification:

$class->wconf("r-text/name","onclick=my_javascript")

You may force a string to appear different from the name of the element in two ways:

grouping elements

It is possible to group elements to force more elements into one single cell by using curly braces, another table will be created and put inside the cell of the parent table. curly braces need to be surrounded by spaces

   first_name last_name
   address    { r=male/sex female/sex }

You can also force elements to span in a simple way just using a dash after the element:

    name -
    te   fax

more documentation

Other features are present but I really don't have any more time to write...