protected function injectToolbar(Response $response, $params)
    {
        if (function_exists('mb_stripos')) {
            $posrFunction = 'mb_strripos';
            $substrFunction = 'mb_substr';
        } else {
            $posrFunction = 'strripos';
            $substrFunction = 'substr';
        }

        $content = $response->getContent();

        if (false !== $pos = $posrFunction($content, '</body>')) {
            $toolbar = "\n".str_replace("\n", '', $this->templating->render(
                'TerrificComposerBundle:Toolbar:toolbar.html.twig', $params
            ))."\n";
            $content = $substrFunction($content, 0, $pos).$toolbar.$substrFunction($content, $pos);
            $response->setContent($content);
        }
    }
protected function injectToolbar(Response $response, $params)
    {
        if (function_exists('mb_stripos')) {
            $posrFunction = 'mb_strripos';
            $substrFunction = 'mb_substr';
        } else {
            $posrFunction = 'strripos';
            $substrFunction = 'substr';
        }

        $content = $response->getContent();

        if (false !== $pos = $posrFunction($content, '</body>')) {
            $toolbar = "\n".str_replace("\n", '', $this->templating->render(
                'TerrificComposerBundle:Toolbar:toolbar.html.twig', $params
            ))."\n";
            $content = $substrFunction($content, 0, $pos).$toolbar.$substrFunction($content, $pos);
            $response->setContent($content);
        }
    }
protected function injectToolbar ( Response $ response , $ params ) { if ( function_exists ( 'mb_stripos' ) ) { $ posrFunction = 'mb_strripos' ; $ substrFunction = 'mb_substr' ; } else { $ posrFunction = 'strripos' ; $ substrFunction = 'substr' ; } $ content = $ response -> getContent ( ) ; if ( false !== $ pos = $ posrFunction ( $ content , '</body>' ) ) { $ toolbar = "\n" . str_replace ( "\n" , '' , $ this -> templating -> render ( 'TerrificComposerBundle:Toolbar:toolbar.html.twig' , $ params ) ) . "\n" ; $ content = $ substrFunction ( $ content , 0 , $ pos ) . $ toolbar . $ substrFunction ( $ content , $ pos ) ; $ response -> setContent ( $ content ) ; } }
Injects the Terrific Composer Toolbar into the given Response.

@param Response $response A Response instance
@param array $params The parameters
Injects the Terrific Composer Toolbar into the given Response .