1 | <?php |
||
6 | class UserForm extends Form |
||
|
|||
7 | { |
||
8 | |||
9 | /** |
||
10 | * @param Controller $controller |
||
11 | * @param string $name |
||
12 | */ |
||
13 | 10 | public function __construct(Controller $controller, $name = 'Form') |
|
52 | |||
53 | 10 | public function setupFormErrors() |
|
62 | |||
63 | /** |
||
64 | * Used for partial caching in the template. |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | public function getLastEdited() |
||
72 | |||
73 | /** |
||
74 | * @return bool |
||
75 | */ |
||
76 | 5 | public function getDisplayErrorMessagesAtTop() |
|
80 | |||
81 | /** |
||
82 | * Return the fieldlist, filtered to only contain steps |
||
83 | * |
||
84 | * @return ArrayList |
||
85 | */ |
||
86 | 10 | public function getSteps() |
|
92 | |||
93 | /** |
||
94 | * Get the form fields for the form on this page. Can modify this FieldSet |
||
95 | * by using {@link updateFormFields()} on an {@link Extension} subclass which |
||
96 | * is applied to this controller. |
||
97 | * |
||
98 | * This will be a list of top level composite steps |
||
99 | * |
||
100 | * @return FieldList |
||
101 | */ |
||
102 | 10 | public function getFormFields() |
|
114 | |||
115 | /** |
||
116 | * Generate the form actions for the UserDefinedForm. You |
||
117 | * can manipulate these by using {@link updateFormActions()} on |
||
118 | * a decorator. |
||
119 | * |
||
120 | * @todo Make form actions editable via their own field editor. |
||
121 | * |
||
122 | * @return FieldList |
||
123 | */ |
||
124 | 10 | public function getFormActions() |
|
141 | |||
142 | /** |
||
143 | * Get the required form fields for this form. |
||
144 | * |
||
145 | * @return RequiredFields |
||
146 | */ |
||
147 | 10 | public function getRequiredFields() |
|
160 | |||
161 | /** |
||
162 | * Override some we can add UserForm specific attributes to the form. |
||
163 | * |
||
164 | * @return array |
||
165 | */ |
||
166 | 6 | public function getAttributes() |
|
167 | { |
||
168 | 6 | $attrs = parent::getAttributes(); |
|
169 | |||
170 | 6 | $attrs['class'] = $attrs['class'] . ' userform'; |
|
171 | 6 | $attrs['data-livevalidation'] = (bool)$this->controller->EnableLiveValidation; |
|
172 | 6 | $attrs['data-toperrors'] = (bool)$this->controller->DisplayErrorMessagesAtTop; |
|
173 | |||
174 | 6 | return $attrs; |
|
175 | } |
||
176 | |||
177 | /** |
||
178 | * @return string |
||
179 | */ |
||
180 | public function getButtonText() { |
||
183 | |||
184 | } |
||
185 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.