@@ -11,40 +11,64 @@ class FormPanel
11
11
{
12
12
private $ html = '' ;
13
13
14
- public function input ($ column ,$ label ,$ value ='' )
14
+ /**
15
+ * @param string $column
16
+ * @param string $label
17
+ * @param string $value
18
+ */
19
+ public function input (string $ column , string $ label , string $ value = '' )
15
20
{
16
21
$ content = <<<EOF
17
22
<div class="input-group">
18
23
<span class="input-group-addon"><i class="fa fa-pencil fa-fw"></i></span>
19
24
<input required="1" type="text" id=" {$ column }" name=" {$ column }" value=" {$ value }" class="form-control {$ column }" placeholder="输入 {$ label }" />
20
25
</div>
21
26
EOF ;
22
- $ this ->html .= $ this ->rowpanel ($ column ,$ label ,$ content );
27
+ $ this ->html .= $ this ->rowpanel ($ column , $ label , $ content );
23
28
}
24
29
25
- public function hidden ($ column ,$ value )
30
+ /**
31
+ * @param string $column
32
+ * @param string $value
33
+ */
34
+ public function hidden (string $ column , string $ value )
26
35
{
27
36
$ this ->html .= <<<EOF
28
37
<input type="hidden" id=" {$ column }" name=" {$ column }" value=" {$ value }" />
29
38
EOF ;
30
39
}
31
40
32
- public function textarea ($ column ,$ label ,$ value ='' )
41
+ /**
42
+ * @param string $column
43
+ * @param string $label
44
+ * @param string $value
45
+ */
46
+ public function textarea (string $ column , string $ label , string $ value = '' )
33
47
{
34
48
$ content = <<<EOF
35
49
<textarea name=" {$ column }" class="form-control {$ column }" rows="3" placeholder="输入 {$ label }"> {$ value }</textarea>
36
50
EOF ;
37
- $ this ->html .= $ this ->rowpanel ($ column ,$ label ,$ content );
51
+ $ this ->html .= $ this ->rowpanel ($ column , $ label , $ content );
38
52
}
39
53
40
- public function select ($ column ,$ options ,$ selected )
54
+ public function select (string $ column , array $ options , int $ selected )
41
55
{
42
56
43
57
}
44
58
45
- public function datepicker ( $ column ,$ label , $ value = '' )
59
+ public function multiSelect ( string $ column , array $ options , array $ selected )
46
60
{
47
- if (!$ value ){
61
+
62
+ }
63
+
64
+ /**
65
+ * @param string $column
66
+ * @param string $label
67
+ * @param string $value
68
+ */
69
+ public function datepicker (string $ column , string $ label , string $ value = '' )
70
+ {
71
+ if (!$ value ) {
48
72
$ value = date ('Y-m-d H:i:s ' );
49
73
}
50
74
$ content = <<<EOF
@@ -62,13 +86,18 @@ function(e) {
62
86
"background-color", "#3c3e43");
63
87
});
64
88
EOF
65
- );
66
- $ this ->html .= $ this ->rowpanel ($ column ,$ label ,$ content );
89
+ );
90
+ $ this ->html .= $ this ->rowpanel ($ column , $ label , $ content );
67
91
}
68
92
69
- public function html ()
93
+ /**
94
+ * @param string $column
95
+ * @param string $label
96
+ * @param string $content
97
+ */
98
+ public function html (string $ column , string $ label , string $ content )
70
99
{
71
-
100
+ $ this -> html .= $ this -> rowpanel ( $ column , $ label , $ content );
72
101
}
73
102
74
103
public function compile ()
@@ -80,7 +109,7 @@ public function compile()
80
109
EOF ;
81
110
}
82
111
83
- private function rowpanel ($ column ,$ label ,$ content )
112
+ private function rowpanel ($ column , $ label , $ content )
84
113
{
85
114
return <<<EOF
86
115
<div class="form-group">
0 commit comments