Method | Description | Returns |
---|---|---|
getType() | Returns the type of the current element. | string |
getMinValue() | float | |
getMaxValue() | float | |
getStepValue() | Returns step setting value. Returns null if setting is not set, step set to 0 or less or setting is set incorrect Returns always float (event if it's an int) value for number inputs. | float |
getErrors() | Gets all violations (error messages) related to the element's current submission | array |
getErrorMessage() | Gets error message for the field. If there are several errors for the element, all of them will be added to this message. | string |
hasErrors() | Returns whether element has at least one error | bool |
getValue(ElementSubmission $submission) | Gets string representation of given submission value. By default, returns values from submission values array (via [[getValues()]] method) imploded by ', '. That is suitable for most of the inputs. For example, InputText is always filled by one value in array, so only one value will be returned. For InputSelect it's ok to use current method if select is not (or was not when was submitted) multiple. If InputSelect (or similar) is multiple, and you use current method, if there is a ',' sing in submitted values, it could be difficult to explode current string then. That's why if InputSelect is "multiple" it's better to use [[getValues()]] method instead. NOTE that submission validness isn't checked here. | string |
getValues(ElementSubmission $submission) | Gets array representation of given submission value even if it's one value array. By default, returns submission values array. Returns null if values are not set at all. NOTE that submission validness isn't checked here. | array |
getName() | string | |
getEntity() | string | |
getId() | int | |
getHelp() | Gets help text for the element. It could be used as a tooltip or in HTML as a title attribute, e.g. ' '. | string |
getEditor() | string | |
getText() | Text for the element that usually is used for element's label | string |
getDefaultValue() | string | |
getPlaceholder() | string | |
isRequired() | bool | |
getRegex() | string | |
getPosition() | int | |
getSettings() | array | |
getRevision() | FormRevision | |
getStep() | Step | |
getSubmissions() | Collection (ElementSubmission) | |
getParent() | ElementGroup | |
isNewRecord() | Check if the record is a new record | bool |
isHierarchicalModel() | Check whether a model is a hierarchical model, i.e. can have children | bool |
Forms\Models\Backend\InputSlider
Entity for ` `. It was decided to call class Slider, not Range, because ` ` looks like slider and range sounds like something to save two values: from and to.