LaravelBook\Laravel4Powerpack\Form::optgroup PHP Method

optgroup() protected method

Create a HTML select element optgroup.
protected optgroup ( array $options, string $label, string $selected ) : string
$options array
$label string
$selected string
return string
    protected function optgroup($options, $label, $selected)
    {
        $html = array();
        foreach ($options as $value => $display) {
            $html[] = $this->option($value, $display, $selected);
        }
        return '<optgroup label="' . $this->html->entities($label) . '">' . implode('', $html) . '</optgroup>';
    }