Renders view defined in data array and passes it to http-responder.

@param array $data
@return Response
546238
public function found(array $data): Response
    {
        $view = $data['view'] ?? '';
        $templateVars = $data['vars'] ?? [];
        $this->response->setBody(
            $this->renderer->render($view, $templateVars)
        );
        return $this->response;
    }
490100
public function setResponse(array $data = null)
    {
        $this->DataArray    = $data;
        $this->ResponseData = json_encode($data);
        return $this;
    }
279450
public function respondWithData(array $data)
    {

        $responseData = $this->getResponseStructure(true, $data, '');
        $response = new JsonResponse($responseData, $this->getStatusCode(), $this->getHeaders());
        return $response;
    }
588584
public function render($view, array $data = [])
    {
        // Get Body-Template
        $template = $this->getTemplate($view);

        // extend with default data
        $data += $this->data;

        // set tags
        foreach ($data as $name => $value) {
            $template->tag($name, $value);
        }

        // Render Page
        return $this->applyFunctions(get_maintemplate((string)$template));
    }
107545
public function render(array $data = [])
	{
		// run the methods
		$this->before();

		if (method_exists($this, $this->method))
		{
			$this->{$this->method}();
		}

		$this->after();

		// transfer the presenter data to the view
		$this->view->merge($this);

		// set autofilter on view
		$this->view->autoFilter($this->autoFilter);

		// render the view
		return $this->view->render($data);
	}
540872
public function render($view, $data = [], $mergeData = [])
    {
        return $this->container['view']->make($view, $data, $mergeData)->render();
    }
40462
protected function viewResponse($view, $data = array(), $status = 200, array $headers = array())
	{
		return $this->response($this->view($view, $data), $status, $headers);
	}
1269576
protected function render($template, $data = array()) {
        Router::getInstance()->render($template, $data);
        $response = ob_get_contents();
        return ob_get_clean();
    }
913814
public function renderJson($data=null)
    {
        $this->beforeRender($data);
        
        $res = ErrorInfo::instance($this->responseData())->all();
        
        foreach ($res as $k => $v) {
            if ($v instanceof Collection) {
                $res[$k] = $v->all();
            }
        }
        
        if ($callback = $this->input('callback')) {
            $string = $callback . '(' . json_encode($res) . ')';
        } else {
            $this->response = $this->response->withHeader('Content-Type', 'application/json;charset=utf-8');
            $string = json_encode($res);
        }
        
        return $this->renderText($string);
    }
660410
public function execute($data = null)
    {
        $this->controller->setResponse(new HtmlResponse(
            '',
            $data->response->getStatusCode(),
            $data->response->getHeaders()
        ));

        $result = $this->next->execute($data);

        $this->controller->setRedirect(null);

        return $result;
    }
846172
public function render(string $view, array $data = []): string
    {
        return $this->native()->render(
            $this->path($view),
            $data
        );
    }
970577
private function response($data)
    {
        // @codeCoverageIgnoreStart
        if (!Yii::$app instanceof \yii\console\Application) {
            \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
        }
        // @codeCoverageIgnoreEnd
        return $data;
    }
657509
public function render($view, array $parameters = [], Response $response = null)
    {
        return $this->templating->renderResponse($view, $parameters, $response);
    }
1346878
public function render(array $data = array())
    {
        parent::render($data);

        if($this->_source instanceof KTemplateEngineInterface)
        {
            $this->_source = $this->_source->render($data);
            $this->_source = $this->filter();
        }

        return $this->_source;
    }
287155
public function output($view, array $data = null)
	{
		$response = new Response($this->render($view, $data), Response::HTTP_OK, ['Content-Type' => 'text/html']);
		$response->send();
	}
945371
public function renderXml($data=null)
    {
        $this->beforeRender($data);
        
        $this->response = $this->response->withHeader('Content-Type', 'application/xml;charset=utf-8');
        
        $string = XmlFormatter::encode($this->responseData()->all());
        
        return static::renderText($string);
    }
501151
public function asJson(array $data)
    {
        $stream = StreamFactory::string(json_encode($data));
        return new Response($stream, self::OK, ['Content-Type' => 'application/json']);
    }