code/libraries/joomlatools/component/koowa/dispatcher/behavior/decoratable.php
protected function _beforeTerminate(KDispatcherContextInterface $context)
    {
        $response = $context->getResponse();

        //Pass back to Joomla
        if(!$response->isRedirect() && !$response->isDownloadable() && $this->getDecorator() == 'joomla')
        {
            // #237 - Since Joomla will wrap the page we do not know the actual content-length and should not send it
            $response->getHeaders()->remove('Content-length');
            header_remove('Content-Length');

            //Contenttype
            JFactory::getDocument()->setMimeEncoding($response->getContentType());

            //Set messages for any request method
            $messages = $response->getMessages();
            foreach($messages as $type => $group)
            {
                if ($type === 'success') {
                    $type = 'message';
                }

                foreach($group as $message) {
                    JFactory::getApplication()->enqueueMessage($message, $type);
                }
            }

            //Set the cache state
            JFactory::getApplication()->allowCache($context->getRequest()->isCacheable());

            //Do not flush the response
            return false;
        }
    }
protected function _beforeTerminate(KDispatcherContextInterface $context)
    {
        $response = $context->getResponse();

        //Pass back to Joomla
        if(!$response->isRedirect() && !$response->isDownloadable() && $this->getDecorator() == 'joomla')
        {
            // #237 - Since Joomla will wrap the page we do not know the actual content-length and should not send it
            $response->getHeaders()->remove('Content-length');
            header_remove('Content-Length');

            //Contenttype
            JFactory::getDocument()->setMimeEncoding($response->getContentType());

            //Set messages for any request method
            $messages = $response->getMessages();
            foreach($messages as $type => $group)
            {
                if ($type === 'success') {
                    $type = 'message';
                }

                foreach($group as $message) {
                    JFactory::getApplication()->enqueueMessage($message, $type);
                }
            }

            //Set the cache state
            JFactory::getApplication()->allowCache($context->getRequest()->isCacheable());

            //Do not flush the response
            return false;
        }
    }
protected function _beforeTerminate ( KDispatcherContextInterface $ context ) { $ response = $ context -> getResponse ( ) ; //Pass back to Joomla if ( ! $ response -> isRedirect ( ) && ! $ response -> isDownloadable ( ) && $ this -> getDecorator ( ) == 'joomla' ) { // #237 - Since Joomla will wrap the page we do not know the actual content-length and should not send it $ response -> getHeaders ( ) -> remove ( 'Content-length' ) ; header_remove ( 'Content-Length' ) ; //Contenttype JFactory :: getDocument ( ) -> setMimeEncoding ( $ response -> getContentType ( ) ) ; //Set messages for any request method $ messages = $ response -> getMessages ( ) ; foreach ( $ messages as $ type => $ group ) { if ( $ type === 'success' ) { $ type = 'message' ; } foreach ( $ group as $ message ) { JFactory :: getApplication ( ) -> enqueueMessage ( $ message , $ type ) ; } } //Set the cache state JFactory :: getApplication ( ) -> allowCache ( $ context -> getRequest ( ) -> isCacheable ( ) ) ; //Do not flush the response return false ; } }
Pass the response to Joomla

@param   KDispatcherContextInterface $context A command context object
@return 	bool
Pass the response to Joomla