protected function updateAttributes(Attributes $attributes) { parent::updateAttributes($attributes); $attributes['value'] = '1'; $attributes['type'] = 'checkbox'; if ($this->value) { $attributes->set('checked', 'checked'); } else { try { $attributes->offsetUnset('checked'); } catch (\OutOfBoundsException $e) { // Do nothing } } }
public function copy() { $copy = parent::copy(); $copy->setStringForFalse($this->falseString); $copy->setStringForTrue($this->trueString); $copy->setSrc($this->getSrc(), $this->manualExtractor); return $copy; }