@@ -24,54 +24,178 @@ abstract class input extends element
24
24
* @brief Input element type - HTML input type attribute.
25
25
**/
26
26
protected $ type ;
27
+
28
+ /**
29
+ * @addtogroup htmlformInputDefaults
30
+ *
31
+ * @default string $label
32
+ * Sets the label for the input
33
+ **/
27
34
/**
28
35
* @brief Input element - HTML label
29
36
**/
30
37
protected $ label ;
38
+
39
+ /**
40
+ * @addtogroup htmlformInputDefaults
41
+ *
42
+ * @default string $marker
43
+ * Sets marker character(s) that gets display on required fields.
44
+ **/
45
+ /**
46
+ * @brief Input element - HTML marker text that marks required fields
47
+ **/
48
+ protected $ marker ;
49
+
50
+ /**
51
+ * @addtogroup htmlformInputDefaults
52
+ *
53
+ * @default bool $required
54
+ * Sets wether an input is required to hold a value to be valid
55
+ **/
31
56
/**
32
57
* @brief True if the input element is required to hold a value to be valid.
33
58
**/
34
59
protected $ required ;
60
+
61
+ /**
62
+ * @addtogroup htmlformInputDefaults
63
+ *
64
+ * @default bool $disabled
65
+ * Enables/disables an input
66
+ **/
67
+ /**
68
+ * @brief wether a input element will be disabled
69
+ **/
70
+ protected $ disabled ;
71
+
35
72
/**
36
73
* @brief Name of the parent HTML form. Used to identify the element once it's rendered.
37
74
**/
38
75
protected $ formName ;
76
+
39
77
/**
40
78
* @brief Input elements's value.
41
79
**/
42
80
protected $ value = null ;
81
+
82
+ /**
83
+ * @addtogroup htmlformInputDefaults
84
+ *
85
+ * @default string|function $validator
86
+ * Sets the validator for the input.
87
+ * - When $validator starts and ends with "/" e.g. "/[a-z0-9]/" the
88
+ * validator will be a depage::htmlform::validators::regEx
89
+ * - When it is a plain string it will be a the validator with the name
90
+ * $validator out of the namespace depage::htmlform::validators.
91
+ * - If the $validator is callable then the validator will be a
92
+ * depage::htmlform::validators::closure
93
+ **/
43
94
/**
44
95
* @brief Holds validator object reference.
45
96
**/
46
97
protected $ validator ;
98
+
99
+ /**
100
+ * @addtogroup htmlformInputDefaults
101
+ *
102
+ * @default string $class
103
+ * Class name or class names that gets added to wrapper paragraph.
104
+ **/
47
105
/**
48
106
* @brief class for paragraph
49
107
**/
50
108
protected $ class ;
109
+
51
110
/**
52
111
* @brief HTML classes attribute for rendering the input element.
53
112
**/
54
113
protected $ classes ;
114
+
115
+ /**
116
+ * @addtogroup htmlformInputDefaults
117
+ *
118
+ * @default bool $autofocus
119
+ * sets current input to get autofocus on a page. If you set the
120
+ * autofocus to more than one input - The first one gets the focus.
121
+ **/
55
122
/**
56
123
* @brief HTML autofocus attribute
57
124
**/
58
125
protected $ autofocus = false ;
126
+
59
127
/**
60
- * @brief HTML autocapitalize attribute
128
+ * @addtogroup htmlformInputDefaults
129
+ *
130
+ * @default bool $autocapitalize
131
+ * Enables/disables autocapitalizion (mostly on mobile devices)
61
132
**/
133
+ /**
134
+ * @brief HTML autocapitalize attribute
135
+ */
62
136
protected $ autocapitalize ;
137
+
63
138
/**
64
- * @brief HTML autocorrect attribute
139
+ * @addtogroup htmlformInputDefaults
140
+ *
141
+ * @default bool $autocorrect
142
+ * Enables/disables autocorrection
65
143
**/
144
+ /**
145
+ * @brief HTML autocorrect attribute
146
+ */
147
+
66
148
protected $ autocorrect ;
67
149
/**
68
- * @brief HTML autocomplete attribute
150
+ * @addtogroup htmlformInputDefaults
151
+ *
152
+ * @default bool $autocomplete
153
+ * Used to enable/disable autocorrect
69
154
**/
155
+ /**
156
+ * @brief HTML autocomplete attribute
157
+ */
70
158
protected $ autocomplete ;
159
+
71
160
/**
72
161
* @brief HTML pattern attribute
73
162
**/
74
163
protected $ pattern ;
164
+
165
+ /**
166
+ * @addtogroup htmlformInputDefaults
167
+ *
168
+ * @default string $errorMessage
169
+ * Sets the message that will be displayed in case of invalid input
170
+ **/
171
+ /**
172
+ * @brief Message that gets displayed in case of invalid input
173
+ **/
174
+ protected $ errorMessage ;
175
+
176
+ /**
177
+ * @addtogroup htmlformInputDefaults
178
+ *
179
+ * @default string $helpMessage
180
+ * Optional help message that may be used for extra information e.g. tooltips.
181
+ * These string will be html escaped.
182
+ **/
183
+ /**
184
+ * @brief Extra help message
185
+ **/
186
+ protected $ helpMessage ;
187
+
188
+ /**
189
+ * @addtogroup htmlformInputDefaults
190
+ *
191
+ * @default string $helpMessageHtml
192
+ * Optional help message that may be used for extra information e.g. tooltips.
193
+ * These string won't be escaped as therefor has to be valid html.
194
+ **/
195
+ /**
196
+ * @brief Extra hep message in html format
197
+ **/
198
+ protected $ helpMessageHtml ;
75
199
// }}}
76
200
77
201
// {{{ __construct()
@@ -98,7 +222,7 @@ public function __construct($name, $parameters, $form)
98
222
99
223
// {{{ setDefaults()
100
224
/**
101
- * @brief Collects initial values across subclasses.
225
+ * @brief Sets the default values for input elements
102
226
*
103
227
* The constructor loops through these and creates settable class
104
228
* attributes at runtime. It's a compact mechanism for initialising
@@ -301,7 +425,7 @@ public function setRequired($required = true)
301
425
/**
302
426
* @brief Sets the HTML disabled-attribute of the current input element.
303
427
*
304
- * @param bool $dіsabled HTML disabled-attribute
428
+ * @param bool $disabled HTML disabled-attribute
305
429
* @return void
306
430
**/
307
431
public function setDisabled ($ disabled = true )
0 commit comments