61 parent::setDefaults();
62 $this->defaults[
'defaultValue'] =
false;
63 $this->defaults[
'errorMessage'] = _(
'Please check this box if you want to proceed');
74 $label = $this->htmlLabel();
80 $selected = ($this->
htmlValue() ===
true) ?
" checked=\"yes\"" :
'';
82 return "<p {$wrapperAttributes}>" .
84 "<input type=\"checkbox\" name=\"{$this->name}\"{$inputAttributes} value=\"true\"{$selected}>" .
85 "<span class=\"depage-label\">{$label}{$marker}</span>" .
103 if (!$this->validated) {
104 $this->validated =
true;
106 $this->valid = (($this->value !==
null)
107 && ($this->validator->validate($this->value) || $this->
isEmpty())
108 && ($this->value || !$this->required)
126 if (is_bool($newValue)) {
127 $this->value = $newValue;
128 } elseif ($newValue ===
"true") {
131 $this->value =
false;
$valid
Contains element validation status/result.
htmlInputAttributes()
Returns string of HTML attributes for input element.
$value
Input elements's value.
$label
Input element - HTML label.
$errorMessage
Message that gets displayed in case of invalid input.
htmlHelpMessage()
Returns HTML-rendered helpMessage.
htmlWrapperAttributes()
Returns string of HTML attributes for element wrapper paragraph.
htmlMarker()
Returns elements' required-indicator.
$helpMessage
Extra help message.
htmlValue()
Returns HTML-rendered element value.
$marker
Input element - HTML marker text that marks required fields.
isEmpty()
says wether the element value is empty
htmlErrorMessage()
Returns HTML-rendered error message.
HTML single checkbox input type.
validate()
validates boolean input element value
__toString()
Renders element to HTML.
setValue($newValue)
set the boolean element value
setDefaults()
collects initial values across subclasses.
Abstract element classes.
Classes for HTML input-elements.