'', 'class' => 'radio', 'type'=>'radio', 'options'=>array() ); protected $protect = array('type'); public function __get($key) { if ($key == 'value') { return $this->selected; } return parent::__get($key); } public function html_element() { // Import base data $data = $this->data; // Get the options and default selection $options = arr::remove('options', $data); $selected = arr::remove('selected', $data); // martin hack unset($data['label']); $html =''; foreach($options as $option=>$labelText){ $html .= form::radio(array ('name' => $data['name'], 'id' => $data['name'] . "_" . $option ), $option, $this->value? $this->value==$option: $data['default']==$option). form::label($data['name']."_".$option , $labelText)." "; } return $html; } protected function load_value() { if (is_bool($this->valid)) return; $this->data['selected'] = $this->input_value($this->name); } } // End Form radio