src/Security/Security.php
protected function renderWrappedController($title, array $fragments, array $templates)
    {
        $controller = $this->getResponseController($title);

        // if the controller calls Director::redirect(), this will break early
        if (($response = $controller->getResponse()) && $response->isFinished()) {
            return $response;
        }

        // Handle any form messages from validation, etc.
        $messageType = '';
        $message = $this->getSessionMessage($messageType);

        // We've displayed the message in the form output, so reset it for the next run.
        static::clearSessionMessage();

        if ($message) {
            $messageResult = [
                'Content'     => DBField::create_field('HTMLFragment', $message),
                'Message'     => DBField::create_field('HTMLFragment', $message),
                'MessageType' => $messageType
            ];
            $fragments = array_merge($fragments, $messageResult);
        }

        return $controller->customise($fragments)->renderWith($templates);
    }
protected function renderWrappedController($title, array $fragments, array $templates)
    {
        $controller = $this->getResponseController($title);

        // if the controller calls Director::redirect(), this will break early
        if (($response = $controller->getResponse()) && $response->isFinished()) {
            return $response;
        }

        // Handle any form messages from validation, etc.
        $messageType = '';
        $message = $this->getSessionMessage($messageType);

        // We've displayed the message in the form output, so reset it for the next run.
        static::clearSessionMessage();

        if ($message) {
            $messageResult = [
                'Content'     => DBField::create_field('HTMLFragment', $message),
                'Message'     => DBField::create_field('HTMLFragment', $message),
                'MessageType' => $messageType
            ];
            $fragments = array_merge($fragments, $messageResult);
        }

        return $controller->customise($fragments)->renderWith($templates);
    }
protected function renderWrappedController ( $ title , array $ fragments , array $ templates ) { $ controller = $ this -> getResponseController ( $ title ) ; // if the controller calls Director::redirect(), this will break early if ( ( $ response = $ controller -> getResponse ( ) ) && $ response -> isFinished ( ) ) { return $ response ; } // Handle any form messages from validation, etc. $ messageType = '' ; $ message = $ this -> getSessionMessage ( $ messageType ) ; // We've displayed the message in the form output, so reset it for the next run. static :: clearSessionMessage ( ) ; if ( $ message ) { $ messageResult = [ 'Content' => DBField :: create_field ( 'HTMLFragment' , $ message ) , 'Message' => DBField :: create_field ( 'HTMLFragment' , $ message ) , 'MessageType' => $ messageType ] ; $ fragments = array_merge ( $ fragments , $ messageResult ) ; } return $ controller -> customise ( $ fragments ) -> renderWith ( $ templates ) ; }
Render the given fragments into a security page controller with the given title.

@param string $title string The title to give the security page
@param array $fragments A map of objects to render into the page, e.g. "Form"
@param array $templates An array of templates to use for the render
@return HTTPResponse|DBHTMLText
Render the given fragments into a security page controller with the given title .