public function render() { //============================================ // Pull items from database //============================================ $data = new data_trans($this->data_src); $data->data_query($this->strsql); $result = $data->data_assoc_result(); foreach ($result as $row) { //----------------------------------------- // Create Radio Button //----------------------------------------- $tmp_radio = new radio($this->name, $row[$this->opt_key]); //----------------------------------------- // Is Checked? //----------------------------------------- if (isset($this->checked_value)) { if ($this->checked_value == $row[$this->opt_key]) { $tmp_radio->set_attribute('checked', 'checked'); } } //----------------------------------------- // Element Attributes //----------------------------------------- if (isset($this->elements_attrs[$row[$this->opt_key]])) { $tmp_radio->attrs($this->elements_attrs[$row[$this->opt_key]]); } //----------------------------------------- // Output //----------------------------------------- $tmp_radio->render(); print ' ' . $row[$this->opt_val]; if ($this->style == 'newline') { print '<br/>'; } else { if ($this->style == 'custom') { print $this->custom_style; } } print "\n"; } }