src/View/Helper/Traits/HelperTrait.php
protected function _prepareBeforeAfterContainer($type, $value)
    {
        $output    = null;
        $iconClass = ($type === 'before') ? 'prefix' : 'postfix';

        if ($value !== null) {
            $output = $value;
            if (is_string($output)) {
                $hasIcon = preg_match('/icon:[a-zA-Z]/', $output);
                if ($hasIcon > 0) {
                    list (, $icon) = explode(':', $output, 2);
                    $icon   = Str::low($icon);
                    $output = $this->Html->icon($icon, ['class' => $iconClass]);
                }
            }
        }

        return $output;
    }
protected function _prepareBeforeAfterContainer($type, $value)
    {
        $output    = null;
        $iconClass = ($type === 'before') ? 'prefix' : 'postfix';

        if ($value !== null) {
            $output = $value;
            if (is_string($output)) {
                $hasIcon = preg_match('/icon:[a-zA-Z]/', $output);
                if ($hasIcon > 0) {
                    list (, $icon) = explode(':', $output, 2);
                    $icon   = Str::low($icon);
                    $output = $this->Html->icon($icon, ['class' => $iconClass]);
                }
            }
        }

        return $output;
    }
protected function _prepareBeforeAfterContainer ( $ type , $ value ) { $ output = null ; $ iconClass = ( $ type === 'before' ) ? 'prefix' : 'postfix' ; if ( $ value !== null ) { $ output = $ value ; if ( is_string ( $ output ) ) { $ hasIcon = preg_match ( '/icon:[a-zA-Z]/' , $ output ) ; if ( $ hasIcon > 0 ) { list ( , $ icon ) = explode ( ':' , $ output , 2 ) ; $ icon = Str :: low ( $ icon ) ; $ output = $ this -> Html -> icon ( $ icon , [ 'class' => $ iconClass ] ) ; } } } return $ output ; }
Prepare before after content for input container.

@param   string|int $type    Set before or after flag.
@param   string|int $value
@return  null|string
Prepare before after content for input container .