public function injectResponse(ViewEvent $e)
    {
        $model = $e->getModel();
        if ($model instanceof ImageModel) {
            $result   = $e->getResult();

            $response = $e->getResponse();
            $response->setContent($result);

            $response->getHeaders()->addHeaderLine('Content-type', $this->getMimeType($model->getFormat()));
        }
    }
public function injectResponse(ViewEvent $e)
    {
        $model = $e->getModel();
        if ($model instanceof ImageModel) {
            $result   = $e->getResult();

            $response = $e->getResponse();
            $response->setContent($result);

            $response->getHeaders()->addHeaderLine('Content-type', $this->getMimeType($model->getFormat()));
        }
    }
public function injectResponse ( ViewEvent $ e ) { $ model = $ e -> getModel ( ) ; if ( $ model instanceof ImageModel ) { $ result = $ e -> getResult ( ) ; $ response = $ e -> getResponse ( ) ; $ response -> setContent ( $ result ) ; $ response -> getHeaders ( ) -> addHeaderLine ( 'Content-type' , $ this -> getMimeType ( $ model -> getFormat ( ) ) ) ; } }
Sets the response based on image returned by the renderer

@param  ViewEvent $e
@return void
Sets the response based on image returned by the renderer