Actions

API16

JResponse/sendHeaders

< API16:JResponse

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description

Send all headers.



Syntax

static sendHeaders()


Returns

void

Defined in

libraries/joomla/environment/response.php

Importing

jimport( 'joomla.environment.response' );

Source Body

public static function sendHeaders()
{
        if (!headers_sent())
        {
                foreach ($GLOBALS['_JRESPONSE']->headers as $header)
                {
                        if ('status' == strtolower($header['name']))
                        {
                                // 'status' headers indicate an HTTP status, and need to be handled slightly differently
                                header(ucfirst(strtolower($header['name'])) . ': ' . $header['value'], null, (int) $header['value']);
                        } else {
                                header($header['name'] . ': ' . $header['value']);
                        }
                }
        }
}



Examples

Code Examples


Advertisement