private function createOptgroupNode($label, array $list)
    {
        $optgroup = new NodeElement();
        $optgroup->openTag('optgroup')
                 ->addAttribute('label', $label)
                 ->finalize();

        foreach ($this->getOptions($list) as $option) {
            $optgroup->appendChild($option);
        }

        $optgroup->closeTag();

        return $optgroup;
    }
private function createOptgroupNode($label, array $list)
    {
        $optgroup = new NodeElement();
        $optgroup->openTag('optgroup')
                 ->addAttribute('label', $label)
                 ->finalize();

        foreach ($this->getOptions($list) as $option) {
            $optgroup->appendChild($option);
        }

        $optgroup->closeTag();

        return $optgroup;
    }
private function createOptgroupNode ( $ label , array $ list ) { $ optgroup = new NodeElement ( ) ; $ optgroup -> openTag ( 'optgroup' ) -> addAttribute ( 'label' , $ label ) -> finalize ( ) ; foreach ( $ this -> getOptions ( $ list ) as $ option ) { $ optgroup -> appendChild ( $ option ) ; } $ optgroup -> closeTag ( ) ; return $ optgroup ; }
Creates optgroup node with nested options

@param string $label
@param array $list
@return \Krystal\Form\NodeElement
Creates optgroup node with nested options