65 if (!($newField instanceof
Base))
67 $newField = $this->convertToField($newField);
70 $indexToInsert =
null;
71 $newFieldsList = array();
72 foreach ($this->fields as $key => $field)
74 if ($field === $targetField)
76 $newField->setForm($this);
77 if ($newField->getKey())
79 $newFieldsList[$newField->getKey()] = $newField;
83 $newFieldsList[] = $newField;
86 $newFieldsList[$key] = $field;
89 $this->fields = $newFieldsList;
101 if (!($newField instanceof
Base))
103 $newField = $this->convertToField($newField);
106 $indexToInsert =
null;
107 $newFieldsList = array();
108 foreach ($this->fields as $key => $field)
110 $newFieldsList[$key] = $field;
111 if ($field === $targetField)
113 $newField->setForm($this);
114 if ($newField->getKey())
116 $newFieldsList[$newField->getKey()] = $newField;
120 $newFieldsList[] = $newField;
125 $this->fields = $newFieldsList;
186 echo htmlspecialcharsbx($this->
getPrefix());
188 $id = $this->
getId();
192 $dataAttributesString =
'';
193 foreach ($dataAttributes as $key => $value)
195 $dataAttributesString .=
' data-' . $key .
'="' . $value .
'" ';
198 $formArguments =
'action="' . (($action !==
null) ? $action :
'#') .
'" ';
199 $formArguments .= ($id !==
null) ?
'id="' . $id .
'" ' :
'';
200 $formArguments .= !empty($class) ?
'class="' . implode(
' ', $class) .
'" ' :
'';
201 $formArguments .= ($name !==
null) ?
'name="' . $name .
'" ' :
'';
202 $formArguments .= $dataAttributesString;
203 echo
'<form ' . $formArguments .
'>';
206 foreach ($fields as $key => $field)