Jarves\PageResponseFactory::createFromRouteWithBody PHP Method

createFromRouteWithBody() public method

If you've a theme then you could specify "theme" at the route options (to have a custom doctype/base template) Note: The actual rendering of $view is delayed to the PageResponse::prepare() which is called shortly before sending the request.
public createFromRouteWithBody ( string $view, array $parameters = [], null | string $routeName = null ) : PageResponse
$view string
$parameters array
$routeName null | string
return PageResponse
    public function createFromRouteWithBody($view, $parameters = [], $routeName = null)
    {
        $pageResponse = $this->createFromRoute($routeName);
        $body = function () use($view, $parameters, $pageResponse) {
            $parameters = array_merge($pageResponse->getPageViewParameter(), $parameters);
            return $this->templating->render($view, $parameters);
        };
        $pageResponse->setBody($body);
        return $pageResponse;
    }