/**
* Additional available options:
*
* * default: The default content (it can be a template name or the content)
* * id: An optional hx:include tag id attribute
* * attributes: An optional array of hx:include tag attributes
*/
public function render(string|ControllerReference
$uri, Request
$request, array
$options =
[]): Response
{ if ($uri instanceof ControllerReference
) { $uri =
(new FragmentUriGenerator($this->fragmentPath,
$this->signer
))->
generate($uri,
$request);
} // We need to replace ampersands in the URI with the encoded form in order to return valid html/xml content.
$uri =
str_replace('&', '&',
$uri);
$template =
$options['default'
] ??
$this->globalDefaultTemplate;
if (null !==
$this->twig &&
$template &&
$this->twig->
getLoader()->
exists($template)) { $content =
$this->twig->
render($template);
} else { $content =
$template;
}