ModelForms module

InputRange

Entity for saving two values as a range: from and to.
Class needs to save two values, so it is not <input type="range"> input.

A model in the Forms module, with 31 members for templates, 24 API properties and 29 members for admin templates.

View
What Smarty and Twig templates receive. Properties in REST API responses and job payloads. What admin screen templates receive when you override them.

Templates view

Properties 29

Take no arguments.

# __toString() Templates only
string
Get a string representation of the element => render the output html
# getType()
string
Returns the type of the current element.
# getMinValue()
?float
# getMaxValue()
?float
# isCurrentlyRequired()
bool
Returns element current required option used in validation
# getStepValue()
?float
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.
# getErrors()
?array
Gets all violations (error messages) related to the element's current submission
# getErrorMessage()
string
Gets error message for the field. If there are several errors for the element, all of them will be added to this message.
# hasErrors()
bool
Returns whether element has at least one error
# getName()
?string
# getEntity()
?string
# getId()
?int
# getHelp()
?string
Gets help text for the element. It could be used as a tooltip or in HTML as a title attribute, e.g. '<input title="{getHelp()}" ...>'.
# getEditor()
?string
# getText()
?string
Text for the element that usually is used for element's label
# getDefaultValue()
?string
# getPlaceholder()
?string
# isRequired()
?bool
# getRegex()
?string
# getPosition()
?int
# getSettings()
?array
# getRevision()
?FormRevision
# getStep()
?Step
# getParent()
?ElementGroup
# getElementId()
?string
# isNewRecord() Not in API & Jobs
bool
Check if the record is a new record
# isHierarchicalModel() Not in API & Jobs
bool
Check whether a model is a hierarchical model, i.e. can have children
# isVersionedModel() Not in API & Jobs
bool
Check whether a model is versioned
# getHtml() Templates only
string
Renders html for input element. Block tag: div.base-element-block.input-element-block Label: label.element-label.element-text Input: input|textArea|select.element-input.{editor: inputText, inputEmail, inputSelect and so on} Validation: div.input-element-validation-errors.invalid-feedback

Methods 2

Take arguments. The API serialises only getters that need none.

# getValue(ElementSubmission $submission)
?string
Gets string representation of given submission value. It returns 2 values imploded by ':'. NOTE that submission validness isn't checked here.
# getValues(ElementSubmission $submission)
?array
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.

API & Jobs view

API & JobsEach property is a key in REST API responses and job payloads. Its name is the template getter without get, is or has. Methods that need arguments are not available here.

Properties 24

Read-only values on the record.

# type
string
Returns the type of the current element.
# minValue
?float
# maxValue
?float
# currentlyRequired
bool
Returns element current required option used in validation
# stepValue
?float
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.
# errors
?array
Gets all violations (error messages) related to the element's current submission
# errorMessage
string
Gets error message for the field. If there are several errors for the element, all of them will be added to this message.
# errors
bool
Returns whether element has at least one error
# name
?string
# entity
?string
# id
?int
# help
?string
Gets help text for the element. It could be used as a tooltip or in HTML as a title attribute, e.g. '<input title="{getHelp()}" ...>'.
# editor
?string
# text
?string
Text for the element that usually is used for element's label
# defaultValue
?string
# placeholder
?string
# required
?bool
# regex
?string
# position
?int
# settings
?array
# revision
?FormRevision
# step
?Step
# parent
?ElementGroup
# elementId
?string

Admin view

AdminAvailable in cdna-admin templates. Copy an admin template into your site repository to change how this record is edited.

Properties 27

Take no arguments.

# getType()
string
Returns the type of the current element.
# getMinValue()
?float
# getMaxValue()
?float
# isCurrentlyRequired()
bool
Returns element current required option used in validation
# getStepValue()
?float
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.
# getErrors()
?array
Gets all violations (error messages) related to the element's current submission
# getErrorMessage()
string
Gets error message for the field. If there are several errors for the element, all of them will be added to this message.
# hasErrors()
bool
Returns whether element has at least one error
# getName()
?string
# getEntity()
?string
# getId()
?int
# getHelp()
?string
Gets help text for the element. It could be used as a tooltip or in HTML as a title attribute, e.g. '<input title="{getHelp()}" ...>'.
# getEditor()
?string
# getText()
?string
Text for the element that usually is used for element's label
# getDefaultValue()
?string
# getPlaceholder()
?string
# isRequired()
?bool
# getRegex()
?string
# getPosition()
?int
# getSettings()
?array
# getRevision()
?FormRevision
# getStep()
?Step
# getParent()
?ElementGroup
# getElementId()
?string
# isNewRecord() Not in API & Jobs
bool
Check if the record is a new record
# isHierarchicalModel() Not in API & Jobs
bool
Check whether a model is a hierarchical model, i.e. can have children
# isVersionedModel() Not in API & Jobs
bool
Check whether a model is versioned

Methods 2

Take arguments. The API serialises only getters that need none.

# getValue(ElementSubmission $submission)
?string
Gets string representation of given submission value. It returns 2 values imploded by ':'. NOTE that submission validness isn't checked here.
# getValues(ElementSubmission $submission)
?array
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.