Example #1
0
 protected static function option($value, $display, $selected)
 {
     if (is_array($selected)) {
         $selected = Arrays::inArray($value, $selected) ? 'selected' : null;
     } else {
         $selected = (string) $value == (string) $selected ? 'selected' : null;
     }
     $attributes = array('value' => View::utf8($value), 'selected' => $selected);
     return '<option' . Html::attributes($attributes) . '>' . View::utf8($display) . '</option>';
 }