protected function _withInputGroup(array $data, ContextInterface $context)
    {
        $data += [
            'prepend' => null,
            'append' => null,
        ];

        if (!isset($data['type']) || $data['type'] !== 'hidden') {
            $data = $this->injectClasses('form-control', $data);
        }

        $prepend = $data['prepend'];
        $append = $data['append'];
        unset($data['append'], $data['prepend']);

        $input = parent::render($data, $context);

        if ($prepend) {
            $prepend = $this->_addon($prepend, $data);
        }
        if ($append) {
            $append = $this->_addon($append, $data);
        }

        if ($prepend || $append) {
            $input = $this->_templates->format('inputGroupContainer', [
                'append' => $append,
                'prepend' => $prepend,
                'content' => $input,
                'templateVars' => $data['templateVars'],
            ]);
        }

        return $input;
    }
protected function _withInputGroup(array $data, ContextInterface $context)
    {
        $data += [
            'prepend' => null,
            'append' => null,
        ];

        if (!isset($data['type']) || $data['type'] !== 'hidden') {
            $data = $this->injectClasses('form-control', $data);
        }

        $prepend = $data['prepend'];
        $append = $data['append'];
        unset($data['append'], $data['prepend']);

        $input = parent::render($data, $context);

        if ($prepend) {
            $prepend = $this->_addon($prepend, $data);
        }
        if ($append) {
            $append = $this->_addon($append, $data);
        }

        if ($prepend || $append) {
            $input = $this->_templates->format('inputGroupContainer', [
                'append' => $append,
                'prepend' => $prepend,
                'content' => $input,
                'templateVars' => $data['templateVars'],
            ]);
        }

        return $input;
    }
protected function _withInputGroup ( array $ data , ContextInterface $ context ) { $ data += [ 'prepend' => null , 'append' => null , ] ; if ( ! isset ( $ data [ 'type' ] ) || $ data [ 'type' ] !== 'hidden' ) { $ data = $ this -> injectClasses ( 'form-control' , $ data ) ; } $ prepend = $ data [ 'prepend' ] ; $ append = $ data [ 'append' ] ; unset ( $ data [ 'append' ] , $ data [ 'prepend' ] ) ; $ input = parent :: render ( $ data , $ context ) ; if ( $ prepend ) { $ prepend = $ this -> _addon ( $ prepend , $ data ) ; } if ( $ append ) { $ append = $ this -> _addon ( $ append , $ data ) ; } if ( $ prepend || $ append ) { $ input = $ this -> _templates -> format ( 'inputGroupContainer' , [ 'append' => $ append , 'prepend' => $ prepend , 'content' => $ input , 'templateVars' => $ data [ 'templateVars' ] , ] ) ; } return $ input ; }
Render a widget with input group wrapper if requried.

Apart from the standard data keys used by a widget you can use following
extra keys:

- `append` Append addon to input.
- `prepend` Prepend addon to input.

@param array $data The data to build an input with.
@param \Cake\View\Form\ContextInterface $context The current form context.
@return string
Render a widget with input group wrapper if requried .