Пример #1
0
 public function addOption($key, $value, $checked = false)
 {
     $element = new Checkbox($this->getName() . '[]', ['value' => $key, 'label' => $value]);
     if ($checked) {
         $element->setChecked();
     }
     $this->options[] = $element;
 }
Пример #2
0
 /**
  * Set field value
  *
  * @param $value
  * @return LabeledCheckbox
  */
 public function setFieldValueFromRequest($value)
 {
     $this->checkbox->setChecked();
     $this->checkbox->setFieldValueFromRequest($value);
     return $this;
 }