Actions

API15

JResponse/getBody

From Joomla! Documentation

< API15:JResponse
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

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

<CodeExamplesForm />