src/Zicht/Bundle/UrlBundle/Aliasing/Listener.php
protected function rewriteResponse(Request $request, Response $response)
    {
        // for debugging purposes. Might need to be configurable.
        if ($request->query->get('__disable_aliasing')) {
            return;
        }
        if (preg_match('!^/admin/!', $request->getRequestUri())) {
            // don't bother here.
            return;
        }

        if ($response->getContent()) {
            $contentType = current(explode(';', $response->headers->get('content-type', 'text/html')));
            $response->setContent(
                $this->aliasing->mapContent(
                    $contentType,
                    UrlMapperInterface::MODE_INTERNAL_TO_PUBLIC,
                    $response->getContent(),
                    [$request->getHttpHost()]
                )
            );
        }
    }
protected function rewriteResponse(Request $request, Response $response)
    {
        // for debugging purposes. Might need to be configurable.
        if ($request->query->get('__disable_aliasing')) {
            return;
        }
        if (preg_match('!^/admin/!', $request->getRequestUri())) {
            // don't bother here.
            return;
        }

        if ($response->getContent()) {
            $contentType = current(explode(';', $response->headers->get('content-type', 'text/html')));
            $response->setContent(
                $this->aliasing->mapContent(
                    $contentType,
                    UrlMapperInterface::MODE_INTERNAL_TO_PUBLIC,
                    $response->getContent(),
                    [$request->getHttpHost()]
                )
            );
        }
    }
protected function rewriteResponse ( Request $ request , Response $ response ) { // for debugging purposes. Might need to be configurable. if ( $ request -> query -> get ( '__disable_aliasing' ) ) { return ; } if ( preg_match ( '!^/admin/!' , $ request -> getRequestUri ( ) ) ) { // don't bother here. return ; } if ( $ response -> getContent ( ) ) { $ contentType = current ( explode ( ';' , $ response -> headers -> get ( 'content-type' , 'text/html' ) ) ) ; $ response -> setContent ( $ this -> aliasing -> mapContent ( $ contentType , UrlMapperInterface :: MODE_INTERNAL_TO_PUBLIC , $ response -> getContent ( ) , [ $ request -> getHttpHost ( ) ] ) ) ; } }
Rewrite URL's from internal naming to public aliases in the response.

@param Request $request
@param Response $response
@return void
Rewrite URL s from internal naming to public aliases in the response .