# Class yii\web\HeadersAlreadySentException

Inheritance | yii\web\HeadersAlreadySentException » yii\base\Exception » Exception
Available since version | 2.0.14
Source Code | https://github.com/yiisoft/yii2/blob/master/framework/web/HeadersAlreadySentException.php

HeadersAlreadySentException represents an exception caused by any headers that were already sent before web response was sent.

## Public Methods

Hide inherited methods

Method | Description | Defined By
--- | --- | ---
__construct() |  | yii\web\HeadersAlreadySentException
getName() |  | yii\base\Exception

## Method Details

Hide inherited methods

__construct() public method

public void __construct ( $file, $line )
$file |  |
$line |  |

Source code

                    public function __construct($file, $line)
    {
        $message = YII_DEBUG ? "Headers already sent in {$file} on line {$line}." : 'Headers already sent.';
        parent::__construct($message);
    }

getName() public method

Defined in: yii\base\Exception::getName()

public string getName ( )
return | string | The user-friendly name of this exception

Source code

                    public function getName()
    {
        return 'Exception';
    }