final public function generateResponse($request = null)
    {
        while (true) {
            $this->setWebRequest($request);

            try {
                if ($request->header("Accept") == "application/leaf") {
                    $response = new XmlResponse($this);
                    $response->setContent($this->renderXhr());
                } else {
                    $response = new HtmlResponse($this);
                    $response->setContent($this->render());
                }

                return $response;
            } catch (RequiresViewReconfigurationException $er) {
                $this->initialiseView();
            }
        }

        return null;
    }
final public function generateResponse($request = null)
    {
        while (true) {
            $this->setWebRequest($request);

            try {
                if ($request->header("Accept") == "application/leaf") {
                    $response = new XmlResponse($this);
                    $response->setContent($this->renderXhr());
                } else {
                    $response = new HtmlResponse($this);
                    $response->setContent($this->render());
                }

                return $response;
            } catch (RequiresViewReconfigurationException $er) {
                $this->initialiseView();
            }
        }

        return null;
    }
final public function generateResponse ( $ request = null ) { while ( true ) { $ this -> setWebRequest ( $ request ) ; try { if ( $ request -> header ( "Accept" ) == "application/leaf" ) { $ response = new XmlResponse ( $ this ) ; $ response -> setContent ( $ this -> renderXhr ( ) ) ; } else { $ response = new HtmlResponse ( $ this ) ; $ response -> setContent ( $ this -> render ( ) ) ; } return $ response ; } catch ( RequiresViewReconfigurationException $ er ) { $ this -> initialiseView ( ) ; } } return null ; }
Renders the Leaf and returns an HtmlResponse to Rhubarb

@param WebRequest|null $request
@return HtmlResponse|null
Renders the Leaf and returns an HtmlResponse to Rhubarb