code: public function setCheckbox($name, $value, $default = false)
      {
          if (isset($this->data[$name])) {
              $return = '';
              foreach ($this->data[$name] as $checkBox) {
                  if ($checkBox == $value) {
                      $return = 'checked';
                  }
              }
              return $return;
          }
          else {
              if ($default) {
                  return 'checked';
              }
              else {
                  return '';
              }
          }
      }
docs: For resetting a form Checkbox's data after a failed validation.
  $name = checkbox's name
  $value = checkbox's value
  $default = whether this checkbox should be checked by default.