Webiny\Component\Bootstrap\ApplicationClasses\Application::httpResponse PHP Method

httpResponse() public method

This method is called automatically by the Dispatcher.
public httpResponse ( ) : Response | boolean
return Webiny\Component\Http\Response | boolean
    public function httpResponse()
    {
        // get the template
        $template = $this->view()->getTemplate();
        // if there is no template, then we return false
        if (empty($template)) {
            return false;
        }
        // get view data
        $viewData = $this->view()->getAssignedData();
        // assign application data to view
        $viewData['App'] = ['Config' => $this->getEnvironmentConfig(), 'Components' => $this->environment->getComponentConfigs()->toArray(), 'Environment' => $this->getEnvironmentName(), 'AbsolutePath' => $this->getAbsolutePath(), 'WebPath' => $this->getWebPath()];
        // render the view and assign it to the response object
        return new Response($this->getTemplateEngineInstance()->fetch($this->view()->getTemplate(), $viewData));
    }