예제 #1
0
파일: common.php 프로젝트: jaz303/zing
 public static function select($name, $value, $choices, $options = array())
 {
     $options['name'] = $name;
     $html = HTMLHelper::opening_tag('select', $options) . "\n";
     foreach ($choices as $k => $v) {
         $s = $k == $value ? ' selected=\\"selected\\"' : '';
         $k = htmlentities($k, ENT_QUOTES);
         $v = htmlspecialchars($v);
         $html .= "<option value=\"{$k}\"{$s}>{$v}</option>\n";
     }
     $html .= "</select>\n";
     return $html;
 }