Пример #1
0
 public function __get($key)
 {
     if ($key == 'value') {
         return $this->selected;
     }
     return parent::__get($key);
 }
Пример #2
0
 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);
 }
Пример #3
0
 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);
 }