-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformhelper.class.php
executable file
·57 lines (53 loc) · 1004 Bytes
/
formhelper.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* FormHelper
*
* @package default
* @author Ryan Abbott
*/
class FormHelper
{
protected $db;
/**
* Magic __construct method
*
* @author Ryan Abbott
*/
public function __construct($data) {
$this->db = new MySQL();
if($data != null) {
// every form element could contain the following
if(isset($data['class'])) {
$this->class = $data['class'];
}
if(isset($data['name'])) {
$this->name = $data['name'];
}
if(isset($data['id'])) {
$this->id = $data['id'];
}
if(isset($data['value'])) {
$this->value = $data['value'];
}
if(isset($data['disabled'])) {
$this->disabled = $data['disabled'];
}
if(isset($data['label'])) {
$this->label = $data['label'];
}
}
}
/**
* toString
*
* @return void
* @author Ryan Abbott
*/
public function toString() {
return "The get_class(this) object does not provide a toString() method.";
}
public function __toString() {
return $this->toString();
}
}
?>