public function input($type, $name, $label = null, $value = null, array $options = [])
    {
        $label = $this->getLabelTitle($label, $name);

        $optionsField = $this->getFieldOptions(array_except($options, ['suffix', 'prefix']), $name);

        $inputElement = '';

         if(isset($options['prefix'])) {
            $inputElement = $options['prefix'];
        }

        $inputElement .= $type === 'password' ? $this->form->password($name, $optionsField) : $this->form->{$type}($name, $value, $optionsField);

         if(isset($options['suffix'])) {
            $inputElement .= $options['suffix'];
        }

         if(isset($options['prefix']) || isset($options['suffix'])) {
            $inputElement = '<div class="input-group">' . $inputElement . '</div>';
        }

        $wrapperOptions = $this->isHorizontal() ? ['class' => $this->getRightColumnClass()] : [];
        $wrapperElement = '<div' . $this->html->attributes($wrapperOptions) . '>' . $inputElement . $this->getFieldError($name) . $this->getHelpText($name, $optionsField) . '</div>';

        return $this->getFormGroup($name, $label, $wrapperElement);
    }
public function input($type, $name, $label = null, $value = null, array $options = [])
    {
        $label = $this->getLabelTitle($label, $name);

        $optionsField = $this->getFieldOptions(array_except($options, ['suffix', 'prefix']), $name);

        $inputElement = '';

         if(isset($options['prefix'])) {
            $inputElement = $options['prefix'];
        }

        $inputElement .= $type === 'password' ? $this->form->password($name, $optionsField) : $this->form->{$type}($name, $value, $optionsField);

         if(isset($options['suffix'])) {
            $inputElement .= $options['suffix'];
        }

         if(isset($options['prefix']) || isset($options['suffix'])) {
            $inputElement = '<div class="input-group">' . $inputElement . '</div>';
        }

        $wrapperOptions = $this->isHorizontal() ? ['class' => $this->getRightColumnClass()] : [];
        $wrapperElement = '<div' . $this->html->attributes($wrapperOptions) . '>' . $inputElement . $this->getFieldError($name) . $this->getHelpText($name, $optionsField) . '</div>';

        return $this->getFormGroup($name, $label, $wrapperElement);
    }
public function input ( $ type , $ name , $ label = null , $ value = null , array $ options = [ ] ) { $ label = $ this -> getLabelTitle ( $ label , $ name ) ; $ optionsField = $ this -> getFieldOptions ( array_except ( $ options , [ 'suffix' , 'prefix' ] ) , $ name ) ; $ inputElement = '' ; if ( isset ( $ options [ 'prefix' ] ) ) { $ inputElement = $ options [ 'prefix' ] ; } $ inputElement .= $ type === 'password' ? $ this -> form -> password ( $ name , $ optionsField ) : $ this -> form -> { $ type } ( $ name , $ value , $ optionsField ) ; if ( isset ( $ options [ 'suffix' ] ) ) { $ inputElement .= $ options [ 'suffix' ] ; } if ( isset ( $ options [ 'prefix' ] ) || isset ( $ options [ 'suffix' ] ) ) { $ inputElement = '<div class="input-group">' . $ inputElement . '</div>' ; } $ wrapperOptions = $ this -> isHorizontal ( ) ? [ 'class' => $ this -> getRightColumnClass ( ) ] : [ ] ; $ wrapperElement = '<div' . $ this -> html -> attributes ( $ wrapperOptions ) . '>' . $ inputElement . $ this -> getFieldError ( $ name ) . $ this -> getHelpText ( $ name , $ optionsField ) . '</div>' ; return $ this -> getFormGroup ( $ name , $ label , $ wrapperElement ) ; }
Create the input group for an element with the correct classes for errors.

@param  string  $type
@param  string  $name
@param  string  $label
@param  string  $value
@param  array   $options
@return string
Create the input group for an element with the correct classes for errors .