private function getFieldAttributes(array $options)
    {
        $fieldAttributes = ['class' => 'form-control'];

        if (isset($options['class'])) {
            $fieldAttributes['class'] .= ' '.$options['class'];
        }

        if (isset($options['id'])) {
            $fieldAttributes += ['id' => $options['id']];
        }
        if (isset($options['readonly']) && $options['readonly'] == true) {
            $fieldAttributes += ['readonly'];
        }
        if (isset($options['disabled']) && $options['disabled'] == true) {
            $fieldAttributes += ['disabled'];
        }
        if (isset($options['required']) && $options['required'] == true) {
            $fieldAttributes += ['required'];
        }
        if (isset($options['min'])) {
            $fieldAttributes += ['min' => $options['min']];
        }
        if (isset($options['max'])) {
            $fieldAttributes += ['max' => $options['max']];
        }
        if (isset($options['step'])) {
            $fieldAttributes += ['step' => $options['step']];
        }
        if (isset($options['style'])) {
            $fieldAttributes += ['style' => $options['style']];
        }

        return $fieldAttributes;
    }
private function getFieldAttributes(array $options)
    {
        $fieldAttributes = ['class' => 'form-control'];

        if (isset($options['class'])) {
            $fieldAttributes['class'] .= ' '.$options['class'];
        }

        if (isset($options['id'])) {
            $fieldAttributes += ['id' => $options['id']];
        }
        if (isset($options['readonly']) && $options['readonly'] == true) {
            $fieldAttributes += ['readonly'];
        }
        if (isset($options['disabled']) && $options['disabled'] == true) {
            $fieldAttributes += ['disabled'];
        }
        if (isset($options['required']) && $options['required'] == true) {
            $fieldAttributes += ['required'];
        }
        if (isset($options['min'])) {
            $fieldAttributes += ['min' => $options['min']];
        }
        if (isset($options['max'])) {
            $fieldAttributes += ['max' => $options['max']];
        }
        if (isset($options['step'])) {
            $fieldAttributes += ['step' => $options['step']];
        }
        if (isset($options['style'])) {
            $fieldAttributes += ['style' => $options['style']];
        }

        return $fieldAttributes;
    }
private function getFieldAttributes ( array $ options ) { $ fieldAttributes = [ 'class' => 'form-control' ] ; if ( isset ( $ options [ 'class' ] ) ) { $ fieldAttributes [ 'class' ] .= ' ' . $ options [ 'class' ] ; } if ( isset ( $ options [ 'id' ] ) ) { $ fieldAttributes += [ 'id' => $ options [ 'id' ] ] ; } if ( isset ( $ options [ 'readonly' ] ) && $ options [ 'readonly' ] == true ) { $ fieldAttributes += [ 'readonly' ] ; } if ( isset ( $ options [ 'disabled' ] ) && $ options [ 'disabled' ] == true ) { $ fieldAttributes += [ 'disabled' ] ; } if ( isset ( $ options [ 'required' ] ) && $ options [ 'required' ] == true ) { $ fieldAttributes += [ 'required' ] ; } if ( isset ( $ options [ 'min' ] ) ) { $ fieldAttributes += [ 'min' => $ options [ 'min' ] ] ; } if ( isset ( $ options [ 'max' ] ) ) { $ fieldAttributes += [ 'max' => $ options [ 'max' ] ] ; } if ( isset ( $ options [ 'step' ] ) ) { $ fieldAttributes += [ 'step' => $ options [ 'step' ] ] ; } if ( isset ( $ options [ 'style' ] ) ) { $ fieldAttributes += [ 'style' => $ options [ 'style' ] ] ; } return $ fieldAttributes ; }
Get field attributes based on given option.

@param  array  $options  Additional form field attributes.
@return array  Array of attributes for the field.
Get field attributes based on given option .