protected function _outputMessageSafe($template)
    {
        $helpers = ['Form', 'Html'];
        $this->controller->helpers = $helpers;
        $builder = $this->controller->viewBuilder();
        $builder->setHelpers($helpers, false)
            ->setLayoutPath('')
            ->setTemplatePath('Error');
        $view = $this->controller->createView('View');

        $this->controller->response = $this->controller->response
            ->withType('html')
            ->withStringBody($view->render($template, 'error'));

        return $this->controller->response;
    }