Skip to content

View Helpers

hasManyRadioButton()

hasManyRadioButton() — returns string

Available in: controller Category: Form Association Functions

Used as a shortcut to output the proper form elements for an association. Note: Pass any additional arguments like class, rel, and id, and the generated tag will also include those values as HTML attributes.

NameTypeRequiredDefaultDescription
objectNamestringyesName of the variable containing the parent object to represent with this form field.
associationstringyesName of the association set in the parent object to represent with this form field.
propertystringyesName of the property in the child object to represent with this form field.
keysstringyesPrimary keys associated with this form field. Note that these keys should be listed in the order that they appear in the database table.
tagValuestringyesThe value of the radio button when selected.
checkIfBlankbooleannofalseWhether or not to check this form field as a default if there is a blank value set for the property.
labelstringnoThe label text to use in the form control.
encodeanynotrueUse this argument to decide whether the output of the function should be encoded in order to prevent Cross Site Scripting (XSS) attacks. Set it to true to encode all relevant output for the specific HTML element in question (e.g. tag content, attribute values, and URLs). For HTML elements that have both tag content and attribute values you can set this argument to attributes to only encode attribute values and not tag content.