ModelForms module
InputCaptcha
Entity for Google reCAPTCHA field.
Based on mode it could be either "I am not a robot" checkbox or invisible badge.
A model in the Forms module, with 30 members for templates, 23 API properties and 28 members for admin templates.
Templates view
Properties 28
Take no arguments.
-
#
__toString()Templates only -
string - Get a string representation of the element => render the output html
-
#
getMode() -
string - Returns specified mode -- checkbox, invisible -- based on settings. Checkbox is used to render "I am not a robot" checkbox. Invisible -- for an invisible badge.
-
#
getSiteKey() -
string - Gets reCAPTCHA site key that is used for its rendering, usually in
data-sitekeyattribute. Returns different keys based on recaptcha input mode. This method is public because you need to render a site key on html. -
#
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.
-
#
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 -
#
getDefaultValue() -
?string -
#
getPlaceholder() -
?string -
#
getRegex() -
?string -
#
getPosition() -
?int -
#
getSettings() -
?array -
#
getRevision() -
?FormRevision -
#
getParent() -
?ElementGroup -
#
getElementId() -
?string -
#
isHierarchicalModel()Not in API & Jobs -
bool - Check whether a model is a hierarchical model, i.e. can have children
-
#
getHtml()Templates only -
string - Renders html for input element. Block tag: div.base-element-block.input-element-block Label: label.element-label.element-text (could be skipped if this is invisible reCAPTCHA badge and there is no error) Input: div.g-recaptcha.element-input.{editor: captcha} HelpCheckbox: input.help-input.inputCaptcha if mode is "checkbox" 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. 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.
-
#
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.
No members match the filter.
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 23
Read-only values on the record.
-
#
mode -
string - Returns specified mode -- checkbox, invisible -- based on settings. Checkbox is used to render "I am not a robot" checkbox. Invisible -- for an invisible badge.
-
#
siteKey -
string - Gets reCAPTCHA site key that is used for its rendering, usually in
data-sitekeyattribute. Returns different keys based on recaptcha input mode. This method is public because you need to render a site key on html. -
#
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.
-
#
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 -
#
defaultValue -
?string -
#
placeholder -
?string -
#
regex -
?string -
#
position -
?int -
#
settings -
?array -
#
revision -
?FormRevision -
#
parent -
?ElementGroup -
#
elementId -
?string
No members match the filter.
Admin view
AdminAvailable in cdna-admin templates. Copy an admin template into your site repository to change how this record is edited.
Properties 26
Take no arguments.
-
#
getMode() -
string - Returns specified mode -- checkbox, invisible -- based on settings. Checkbox is used to render "I am not a robot" checkbox. Invisible -- for an invisible badge.
-
#
getSiteKey() -
string - Gets reCAPTCHA site key that is used for its rendering, usually in
data-sitekeyattribute. Returns different keys based on recaptcha input mode. This method is public because you need to render a site key on html. -
#
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.
-
#
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 -
#
getDefaultValue() -
?string -
#
getPlaceholder() -
?string -
#
getRegex() -
?string -
#
getPosition() -
?int -
#
getSettings() -
?array -
#
getRevision() -
?FormRevision -
#
getParent() -
?ElementGroup -
#
getElementId() -
?string -
#
isHierarchicalModel()Not in API & Jobs -
bool - Check whether a model is a hierarchical model, i.e. can have children
Methods 2
Take arguments. The API serialises only getters that need none.
-
#
getValue(ElementSubmission $submission) -
?string - 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.
-
#
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.
No members match the filter.