From 07f5140771388c9e0c8a99b0dd2e5d950bdb173b Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Thu, 14 Oct 2021 15:16:42 +1100 Subject: moving h-source subdir out. --- Library/Form/Form.php | 140 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100755 Library/Form/Form.php (limited to 'Library/Form/Form.php') diff --git a/Library/Form/Form.php b/Library/Form/Form.php new file mode 100755 index 0000000..a1a9fda --- /dev/null +++ b/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