Example #1
0
 public function __get($key)
 {
     if ($key == 'value') {
         return $this->selected;
     }
     return parent::__get($key);
 }
Example #2
0
 public function __get($key)
 {
     if ($key == 'value') {
         // Return the value if the checkbox is checked
         return $this->data['checked'] ? $this->data['value'] : nil;
     }
     return parent::__get($key);
 }
Example #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] === YES and $array[] = $id;
         }
         return $array;
     }
     return parent::__get($key);
 }