36 if ($value ==
"checked" || $value ===
"" || is_bool($value)) {
50 $value = $value ??
false;
52 if (!is_bool($value)) {
53 throw new \InvalidArgumentException(
54 "Unknown value type for checkbox: " . gettype($value)
61 $clone = parent::withValue($value);
71 if ($this->getName() === null) {
72 throw new \LogicException(
"Can only collect if input has a name.");
76 $value = $post_input->
getOr($this->getName(),
"");
77 $clone = $this->
withValue($value ===
"checked");
83 $clone->content = $this->applyOperationsTo($clone->getValue());
84 if ($clone->content->isError()) {
85 return $clone->withError(
"" . $clone->content->error());
128 return function ($id) {
129 $code =
"$('#$id').on('input', function(event) { 130 il.UI.input.onFieldUpdate(event, '$id', $('#$id').prop('checked').toString()); 132 il.UI.input.onFieldUpdate(event, '$id', $('#$id').prop('checked').toString());";
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
appendTriggeredSignal(Component\Signal $signal, $event)
Append a triggered signal to other signals of the same event.
withTriggeredSignal(Component\Signal $signal, $event)
Add a triggered signal, replacing any other signals registered on the same event. ...