API15:JResponse/getBody
From Joomla! Documentation
Description
Return the body content
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
getBody($toArray=false)
| Parameter Name | Default Value | Description |
|---|---|---|
| $toArray | false | $toArray Whether or not to return the body content as an array of strings or as a single string; defaults to false |
Returns
string|array
Defined in
libraries/joomla/environment/response.php
Importing
jimport( 'joomla.environment.response' );
Source Body
function getBody($toArray = false)
{
if ($toArray) {
return $GLOBALS['_JRESPONSE']->body;
}
ob_start();
foreach ($GLOBALS['_JRESPONSE']->body as $content) {
echo $content;
}
return ob_get_clean();
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples