public function __get($key) { if ($key == 'value') { return $this->selected; } return parent::__get($key); }
public function __get($key) { if ($key == 'value') { // Return the value if the checkbox is checked return $this->data['checked'] ? $this->data['value'] : NULL; } return parent::__get($key); }
public function __get($key) { if ($key == 'value') { // Return the currently checked values $array = array(); foreach ($this->data['options'] as $id => $opt) { // Return the options that are checked $opt[1] === TRUE and $array[] = $id; } return $array; } return parent::__get($key); }