Skip to content

Commit 27e8777

Browse files
committed
Document NumericRangeFormField
Closes #500
1 parent 0a2aa05 commit 27e8777

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

docs/php/api/form_builder/form_fields.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,26 @@ NoticeFormNode::create('name')
313313
->languageItem('name_of_language_item');
314314
```
315315

316+
### `NumericRangeFormField`
317+
318+
`NumericRangeFormField` is a form field to enter a numeric range, consisting of a minimum and a maximum value.
319+
The two values are separated by a semicolon in the value.
320+
The class implements `IAttributeFormField`, `IAutoFocusFormField`, `ICssClassFormField`, `IImmutableFormField`, and `INullableFormField`.
321+
322+
The following methods are specific to this form field class:
323+
324+
- `integerValues(bool $value = true)` can be used to toggle whether the field only accepts integers or also decimals. By default, decimals are accepted.
325+
326+
327+
Example:
328+
329+
```php
330+
NumericRangeFormField::create('example')
331+
->label('foo.bar.example')
332+
->integerValues()
333+
->value('1;10')
334+
```
335+
316336

317337
### `RadioButtonFormField`
318338

0 commit comments

Comments
 (0)