
catalin - 2012-10-22 08:04:12 -
In reply to message 1 from Ferrand Gérard
Hi.
In form.php file, in comment part of file, is an example of how to use this classes. But i will try here to show few things:
-first you need to load classes or use autoload function;
//initialise a new form
$form=new form();
//add attributes to form
$form->method='post'
$form->action=''
//add tag to form - default is table, so if you want to put your form in a //table don't need to add tags
//ATTENTION: if you change tags you MUST change all tags from elements and //labels.
$form->addTag(NULL)
//add first text element
$name=$form->addElement('name','text');
//add label for this element
$name->addLabel('Your name: ');
//add tag for label (default is td, if you change table MUST change
$name->addLabelTag('span');
//add attributes for element
$name->id='name';
$name->placeholder('Your name');
$name->addTag('span');//MUST
//add content tag for element togeter with label
$name->addMasterTag('div',array('id'=>'tagID'));
....
//print form
$form->showElements($name);
Something like this. If you have more questions I am here.