In Joomla 3.x versions I use JResponse to get and set the body.
function onAfterRender() {
$content = JResponse::getBody();
...
}
But in Joomla4 it returns Class 'JResponse' not found. So how to get the body in Joomla4?
Thanks
JFactory::getApplication()->getBody() / setBody()
as an alternative... joomla.stackexchange.com/q/323/12352 Another suggestion is found on the Joomla forum -- though not speaking directly about J4... forum.joomla.org/viewtopic.php?t=941835 have you triedJApplicationWeb::getBody();
?