src/Widgets/JustATextOption.php
private function checkOptGroup($options, $class, $style)
    {
        foreach ($options as $option) {
            // If it is an option group, handle it.
            if (!isset($option['value'])) {
                $result = $this->checkOptGroup($option, $class, $style);
                if ($result) {
                    return $result;
                }

                continue;
            }

            // No option group, check if it is selected.
            if ($this->isSelected($option)) {
                return sprintf(
                    '<input type="hidden" id="ctrl_%s" name="%s" value="%s" /><span%s>%s</span>',
                    $this->strId,
                    $this->strName,
                    StringUtil::specialchars($option['value']),
                    $class . $style,
                    $option['label']
                );
            }
        }

        return null;
    }
private function checkOptGroup($options, $class, $style)
    {
        foreach ($options as $option) {
            // If it is an option group, handle it.
            if (!isset($option['value'])) {
                $result = $this->checkOptGroup($option, $class, $style);
                if ($result) {
                    return $result;
                }

                continue;
            }

            // No option group, check if it is selected.
            if ($this->isSelected($option)) {
                return sprintf(
                    '<input type="hidden" id="ctrl_%s" name="%s" value="%s" /><span%s>%s</span>',
                    $this->strId,
                    $this->strName,
                    StringUtil::specialchars($option['value']),
                    $class . $style,
                    $option['label']
                );
            }
        }

        return null;
    }
private function checkOptGroup ( $ options , $ class , $ style ) { foreach ( $ options as $ option ) { // If it is an option group, handle it. if ( ! isset ( $ option [ 'value' ] ) ) { $ result = $ this -> checkOptGroup ( $ option , $ class , $ style ) ; if ( $ result ) { return $ result ; } continue ; } // No option group, check if it is selected. if ( $ this -> isSelected ( $ option ) ) { return sprintf ( '<input type="hidden" id="ctrl_%s" name="%s" value="%s" /><span%s>%s</span>' , $ this -> strId , $ this -> strName , StringUtil :: specialchars ( $ option [ 'value' ] ) , $ class . $ style , $ option [ 'label' ] ) ; } } return null ; }
Scan an option group for the selected option.

@param array  $options The option array.

@param string $class   The html class to use.

@param string $style   The html style to use.

@return null|string
Scan an option group for the selected option .