From 129934f892850a90f98f8f5a0e7746cfe57bb958 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Mon, 28 May 2012 15:31:57 +0000 Subject: added new EasyGiant library --- h-source/Library/Form/Form.php | 140 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100755 h-source/Library/Form/Form.php (limited to 'h-source/Library/Form/Form.php') diff --git a/h-source/Library/Form/Form.php b/h-source/Library/Form/Form.php new file mode 100755 index 0000000..a1a9fda --- /dev/null +++ b/h-source/Library/Form/Form.php @@ -0,0 +1,140 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +//create the HTML of the whole form +class Form_Form { + + public $entry = array(); //associative array containing the entries of the form (objects that inherit the class form_entryModel). Each element of the array corresponds to one field of the table + + public $action = null; //the action of the form + public $name = null; //the name of the form + public $className = 'formClass'; //the class of the form + public $id = null; + public $submit = array(); //the submit entries array('name'=>'value') + public $method = 'POST'; //the transmission method: POST/GET + public $enctype = null; //enctype attribute of the form + + public function __construct($action,$submit = array('generalAction'=>'save'),$method = 'POST',$enctype = null) + { + $this->action = $action; //action of the form: controller/action + $this->submit = $submit; + $this->method = $method; + $this->enctype = $enctype; + } + + //method to manage the $this->entry associative array + //entryType: the type of the object to be initialized, $entryName: the name of the entry + //$options: the list of options (if the entry is a \n\n"; + } + $htmlForm .= "\n"; + return $htmlForm; + } + +} -- cgit v1.2.3