src/Form.php
public function options($options, $name, $default = null, $placeholder = null)
    {
        $tags = [];
        // Prepend the placeholder to the options list if needed.
        if ($placeholder) {
            $tags[] = '<option value="" selected disabled>'.e($placeholder).'</option>';
        }
        $value = $this->value($name, $default);
        // Cast $default and $value to an array in order to support selects with
        // multiple options selected.
        if (! is_array($value)) {
            $value = [$value];
        }

        foreach ($options as $key => $text) {
            $selected = in_array($key, $value) ? ' selected' : '';
            $key = e($key);
            $text = e($text);
            $tags[] = "<option value=\"$key\"$selected>$text</option>";
        }
        return implode($tags);
    }
public function options($options, $name, $default = null, $placeholder = null)
    {
        $tags = [];
        // Prepend the placeholder to the options list if needed.
        if ($placeholder) {
            $tags[] = '<option value="" selected disabled>'.e($placeholder).'</option>';
        }
        $value = $this->value($name, $default);
        // Cast $default and $value to an array in order to support selects with
        // multiple options selected.
        if (! is_array($value)) {
            $value = [$value];
        }

        foreach ($options as $key => $text) {
            $selected = in_array($key, $value) ? ' selected' : '';
            $key = e($key);
            $text = e($text);
            $tags[] = "<option value=\"$key\"$selected>$text</option>";
        }
        return implode($tags);
    }
public function options ( $ options , $ name , $ default = null , $ placeholder = null ) { $ tags = [ ] ; // Prepend the placeholder to the options list if needed. if ( $ placeholder ) { $ tags [ ] = '<option value="" selected disabled>' . e ( $ placeholder ) . '</option>' ; } $ value = $ this -> value ( $ name , $ default ) ; // Cast $default and $value to an array in order to support selects with // multiple options selected. if ( ! is_array ( $ value ) ) { $ value = [ $ value ] ; } foreach ( $ options as $ key => $ text ) { $ selected = in_array ( $ key , $ value ) ? ' selected' : '' ; $ key = e ( $ key ) ; $ text = e ( $ text ) ; $ tags [ ] = "<option value=\"$key\"$selected>$text</option>" ; } return implode ( $ tags ) ; }
Get the options for a select.

@param  array $options
@param  string $name
@param  mixed|null $default
@param  string|null $placeholder
@return string
Get the options for a select .