hc/SelectedOptions.php
/**
     * Format HTML component to HTML string 
     * @return string
     */
Format HTML component to HTML string
@return string
Format HTML component to HTML string @return string
public function toHtml() {
        if (empty($this->_select_options)) {
            return '';
        }
        $html = '';
        $selected = $this->_selected_item;
        foreach ($this->_select_options as $key => $value) {
            $html .= '<option value="' . $key;
            if ($selected == $key) {
                $html .= '" selected>';
            } else {
                $html .= '">';
            }
            $html .= $value . '</option>';
        }
        return $html;
    }
public function toHtml ( ) { if ( empty ( $ this -> _select_options ) ) { return '' ; } $ html = '' ; $ selected = $ this -> _selected_item ; foreach ( $ this -> _select_options as $ key => $ value ) { $ html .= '<option value="' . $ key ; if ( $ selected == $ key ) { $ html .= '" selected>' ; } else { $ html .= '">' ; } $ html .= $ value . '</option>' ; } return $ html ; }
Format HTML component to HTML string
 @return string
Format HTML component to HTML string @return string