Phlyty\App::render PHP Method

render() public method

Renders a template, with any view model provided, and injects the content into the response object.
public render ( string $template, array | object $viewModel = [] ) : App
$template string
$viewModel array | object
return App
    public function render($template, $viewModel = [])
    {
        $view = $this->view();
        $content = $view->render($template, $viewModel);
        $response = $this->response();
        $response->setContent($content);
        return $this;
    }