protected function htmlOptionsSet($name, $additional = [], $appendStyle = '')
    {
        $class = !empty($this->defaults[$name . 'Class']) ? $this->defaults[$name . 'Class'] : '';
        $style = !empty($this->defaults[$name . 'Style']) ? $this->defaults[$name . 'Style'] : '';

        if (!empty($this->bootstrapDefaults[$name . 'Class'])) {
            $class .= $this->bootstrapDefaults[$name . 'Class'];
        }
        if (!empty($this->bootstrapDefaults[$name . 'Style'])) {
            $style .= $this->bootstrapDefaults[$name . 'Style'];
        }
        if (!empty($this->{$name . 'Class'}) && is_string($this->{$name . 'Class'})) {
            $class .= ' ' . $this->{$name . 'Class'};
        }
        if (!empty($this->{$name . 'Style'}) && is_string($this->{$name . 'Style'})) {
            $style .= ' ' . $this->{$name . 'Style'};
        }

        $return = [
            'class' => $class ? : null,
            'style' => $style ? : null,
        ];

        if (count($additional)) {
            $return = array_merge($return, $additional);
        }
        if ($appendStyle != '') {
            if (!empty($return['style'])) {
                $return['style'] .= (substr(trim($return['style']), -1) != ';' ? ';' : '') . $appendStyle;
            } else {
                $return['style'] = $appendStyle;
            }
        }

        return $return;
    }
protected function htmlOptionsSet($name, $additional = [], $appendStyle = '')
    {
        $class = !empty($this->defaults[$name . 'Class']) ? $this->defaults[$name . 'Class'] : '';
        $style = !empty($this->defaults[$name . 'Style']) ? $this->defaults[$name . 'Style'] : '';

        if (!empty($this->bootstrapDefaults[$name . 'Class'])) {
            $class .= $this->bootstrapDefaults[$name . 'Class'];
        }
        if (!empty($this->bootstrapDefaults[$name . 'Style'])) {
            $style .= $this->bootstrapDefaults[$name . 'Style'];
        }
        if (!empty($this->{$name . 'Class'}) && is_string($this->{$name . 'Class'})) {
            $class .= ' ' . $this->{$name . 'Class'};
        }
        if (!empty($this->{$name . 'Style'}) && is_string($this->{$name . 'Style'})) {
            $style .= ' ' . $this->{$name . 'Style'};
        }

        $return = [
            'class' => $class ? : null,
            'style' => $style ? : null,
        ];

        if (count($additional)) {
            $return = array_merge($return, $additional);
        }
        if ($appendStyle != '') {
            if (!empty($return['style'])) {
                $return['style'] .= (substr(trim($return['style']), -1) != ';' ? ';' : '') . $appendStyle;
            } else {
                $return['style'] = $appendStyle;
            }
        }

        return $return;
    }
protected function htmlOptionsSet ( $ name , $ additional = [ ] , $ appendStyle = '' ) { $ class = ! empty ( $ this -> defaults [ $ name . 'Class' ] ) ? $ this -> defaults [ $ name . 'Class' ] : '' ; $ style = ! empty ( $ this -> defaults [ $ name . 'Style' ] ) ? $ this -> defaults [ $ name . 'Style' ] : '' ; if ( ! empty ( $ this -> bootstrapDefaults [ $ name . 'Class' ] ) ) { $ class .= $ this -> bootstrapDefaults [ $ name . 'Class' ] ; } if ( ! empty ( $ this -> bootstrapDefaults [ $ name . 'Style' ] ) ) { $ style .= $ this -> bootstrapDefaults [ $ name . 'Style' ] ; } if ( ! empty ( $ this -> { $ name . 'Class' } ) && is_string ( $ this -> { $ name . 'Class' } ) ) { $ class .= ' ' . $ this -> { $ name . 'Class' } ; } if ( ! empty ( $ this -> { $ name . 'Style' } ) && is_string ( $ this -> { $ name . 'Style' } ) ) { $ style .= ' ' . $ this -> { $ name . 'Style' } ; } $ return = [ 'class' => $ class ? : null , 'style' => $ style ? : null , ] ; if ( count ( $ additional ) ) { $ return = array_merge ( $ return , $ additional ) ; } if ( $ appendStyle != '' ) { if ( ! empty ( $ return [ 'style' ] ) ) { $ return [ 'style' ] .= ( substr ( trim ( $ return [ 'style' ] ) , - 1 ) != ';' ? ';' : '' ) . $ appendStyle ; } else { $ return [ 'style' ] = $ appendStyle ; } } return $ return ; }
Sets HTML options for chosen element.
@param string $name Name of the element
@param array $additional Additional HTML options
@param string $appendStyle Additional CSS style
@return array
Sets HTML options for chosen element .