public function optgroup(Optgroup $optgroup)
    {
        $innerHtml = '';
        foreach ($optgroup->getOptions() as $option) {
            $innerHtml .= $this->render($option) . PHP_EOL;
        }

        $tag = new Tag('optgroup', $innerHtml);
        $tag->setAttribute('label', $optgroup->getLabel());

        return $this->parseTag($tag, $optgroup);
    }
public function optgroup(Optgroup $optgroup)
    {
        $innerHtml = '';
        foreach ($optgroup->getOptions() as $option) {
            $innerHtml .= $this->render($option) . PHP_EOL;
        }

        $tag = new Tag('optgroup', $innerHtml);
        $tag->setAttribute('label', $optgroup->getLabel());

        return $this->parseTag($tag, $optgroup);
    }
public function optgroup ( Optgroup $ optgroup ) { $ innerHtml = '' ; foreach ( $ optgroup -> getOptions ( ) as $ option ) { $ innerHtml .= $ this -> render ( $ option ) . PHP_EOL ; } $ tag = new Tag ( 'optgroup' , $ innerHtml ) ; $ tag -> setAttribute ( 'label' , $ optgroup -> getLabel ( ) ) ; return $ this -> parseTag ( $ tag , $ optgroup ) ; }
Render an Optgroup

@param Optgroup $optgroup
@return string
Render an Optgroup