7
7
class FormElement extends Container {
8
8
9
9
protected $ label ;
10
+ protected $ isArray ;
10
11
protected $ help ;
11
12
protected $ group ;
12
13
protected $ hidden ;
@@ -17,7 +18,8 @@ public function __construct($parent, $id) {
17
18
$ this ->setId ($ id );
18
19
$ this ->setName ($ id );
19
20
}
20
- $ this ->hidden = FALSE ;
21
+ $ this ->hidden = FALSE ;
22
+ $ this ->isArray = FALSE ;
21
23
}
22
24
23
25
public function hide () {
@@ -50,6 +52,17 @@ public function setHelp($value) {
50
52
return $ this ;
51
53
}
52
54
55
+ public function isArray () {
56
+ return $ this ->isArray ;
57
+ }
58
+
59
+ public function setArray ($ value ) {
60
+ $ this ->isArray = $ value ;
61
+ foreach ($ this ->getChildren () AS $ child ) {
62
+ if (method_exists ($ child , 'setArray ' )) $ child ->setArray ($ value );
63
+ }
64
+ }
65
+
53
66
public function getName () {
54
67
return $ this ->getAttribute ('name ' , TRUE , $ this ->getId ());
55
68
}
@@ -59,17 +72,9 @@ public function setName($name) {
59
72
return $ this ;
60
73
}
61
74
62
- public function getBaseName () {
63
- $ rc = $ this ->getName ();
64
- if (mb_strpos ($ this ->getName (), '[] ' ) > 0 ) {
65
- $ rc = mb_substr ($ rc , 0 , mb_strlen ($ rc )-2 );
66
- }
67
- return $ rc ;
68
- }
69
-
70
- public function isArray () {
71
- return mb_strpos ($ this ->getName (), '[] ' ) > 0 ;
72
- }
75
+ //public function isArray() {
76
+ // return mb_strpos($this->getName(), '[]') > 0;
77
+ //}
73
78
74
79
public function isEnabled () {
75
80
return $ this ->getAttribute ('disabled ' , TRUE ) != 'disabled ' ;
0 commit comments