:::

MarkDown

'; } } //下拉式選單也是繼承FormElement類別,並覆寫output方法,輸出select標籤動態表單 class FormElement_select extends FormElement { private $_itemarr= array(); public function set_itemgroup(Array $itemarr){ $this->_itemarr=$itemarr; } public function output() { $html=''; return $html; } } //單選框也是繼承FormElement類別,並覆寫output方法,輸出radio標籤動態表單 class FormElement_radio extends FormElement { private $_itemarr= array(); public function set_itemgroup(Array $itemarr){ $this->_itemarr=$itemarr; } public function output() { $html=""; foreach($this->_itemarr as $key => $arr){ $checked=($this->_value==$key)?'checked':''; $html.=''; } return $html; } } ?> ```