__construct()
getDescription()
getId()
getLabel()
getName()
isRequired()
outputHTML()
setDescription()
setId()
setLabel()
setName()
showInEmail()
showLabel()
Creates a checkbox form element.
| package | FormItBuilder |
|---|
__construct(string $id, string $label, string $value, boolean $uncheckedValue, boolean $checked)
Creates a checkbox form element.
stringID of checkbox
stringLabel of checkbox
stringValue to show if user selects the checkbox
booleanValue to show if user does not check the checkbox
booleanMake checkbox ticked by default
getDescription() : string
Returns the form elements description.
| inherited_from | \FormItBuilder_element::getDescription() |
|---|
stringgetId() : string
Returns the form elements ID.
| inherited_from | \FormItBuilder_element::getId() |
|---|
stringgetLabel() : string
Returns the form elements label.
| inherited_from | \FormItBuilder_element::getLabel() |
|---|
stringgetName() : string
Returns the form elements name.
| inherited_from | \FormItBuilder_element::getName() |
|---|
stringisRequired(boolean $value) : boolean
Sets wether the element is required or not.
This setting is generally toggled automatically based on FormRule settings applied in the form.
If no value passed the method will return the current required status.
| inherited_from | \FormItBuilder_element::isRequired() |
|---|
booleanIf true the field must be filled out.
booleanoutputHTML() : string
Outputs the HTML for the element.
stringsetDescription(string $value)
Allows a sub label (or more descriptive label) to be set within the element label. Could be shown on hover or displayed with main label.
| inherited_from | \FormItBuilder_element::setDescription() |
|---|
string
setId(string $value)
Sets the form elements ID.
| inherited_from | \FormItBuilder_element::setId() |
|---|
string
setLabel(string $value)
Sets the form elements label.
| inherited_from | \FormItBuilder_element::setLabel() |
|---|
string
setName(string $value)
Sets the form elements name.
| inherited_from | \FormItBuilder_element::setName() |
|---|
string
showInEmail(boolean $value) : boolean
Sets wether the element is shown in the email or not.
In some cases fields may be wanted in the form, but not in the email (an example would be fields like a "Confirm Password" field).
If no value passed the method will return the current status.
| inherited_from | \FormItBuilder_element::showInEmail() |
|---|
booleanIf true (which is in most cases default) the element will be shown in the email.
booleanshowLabel(boolean $value) : boolean
Sets wether the label should be displayed for this element or not. If no value passed the method will return the current status.
| inherited_from | \FormItBuilder_element::showLabel() |
|---|
booleanIf true (which is in most cases default) a label will be shown next to the form element and in the email.
boolean