library/Benri/Controller/Action.php
public function postDispatch()
    {
        if ($this->view instanceof Zend_View_Interface) {
            // Common variables used in all views.
            $this->view->assign([
                'errors'    => $this->_errors,
                'messages'  => $this->_messages,
                'title'     => $this->_title,
            ]);

            // XMLHttpRequest requests should not render the entire layout,
            // only the correct templates related to the action.
            if ($this->getRequest()->isXmlHttpRequest()) {
                $this->getHelper('layout')->disableLayout();
            }

            $this->getResponse()->setHeader('Content-Type', 'text/html; charset=utf-8', true);
        }
    }
public function postDispatch()
    {
        if ($this->view instanceof Zend_View_Interface) {
            // Common variables used in all views.
            $this->view->assign([
                'errors'    => $this->_errors,
                'messages'  => $this->_messages,
                'title'     => $this->_title,
            ]);

            // XMLHttpRequest requests should not render the entire layout,
            // only the correct templates related to the action.
            if ($this->getRequest()->isXmlHttpRequest()) {
                $this->getHelper('layout')->disableLayout();
            }

            $this->getResponse()->setHeader('Content-Type', 'text/html; charset=utf-8', true);
        }
    }
public function postDispatch ( ) { if ( $ this -> view instanceof Zend_View_Interface ) { // Common variables used in all views. $ this -> view -> assign ( [ 'errors' => $ this -> _errors , 'messages' => $ this -> _messages , 'title' => $ this -> _title , ] ) ; // XMLHttpRequest requests should not render the entire layout, // only the correct templates related to the action. if ( $ this -> getRequest ( ) -> isXmlHttpRequest ( ) ) { $ this -> getHelper ( 'layout' ) -> disableLayout ( ) ; } $ this -> getResponse ( ) -> setHeader ( 'Content-Type' , 'text/html; charset=utf-8' , true ) ; } }
Post-dispatch routines.

Common usages for `postDispatch()` include rendering content in a
sitewide template, link url correction, setting headers, etc.
Post - dispatch routines .