36 if ($value ==
"checked" || $value ===
"" || is_bool($value)) {
50 if (!is_bool($value)) {
51 throw new \InvalidArgumentException(
52 "Unknown value type for checkbox: " . gettype($value)
56 return parent::withValue($value);
65 if ($this->getName() === null) {
66 throw new \LogicException(
"Can only collect if input has a name.");
70 $value = $post_input->
getOr($this->getName(),
"");
71 $clone = $this->
withValue($value ===
"checked");
77 $clone->content = $this->applyOperationsTo($clone->getValue());
78 if ($clone->content->isError()) {
79 return $clone->withError(
"" . $clone->content->error());
122 return function ($id) {
123 $code =
"$('#$id').on('input', function(event) { 124 il.UI.input.onFieldUpdate(event, '$id', $('#$id').prop('checked').toString()); 126 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. ...