Back to CMSApplication class

Method toString

public string
toString
(mixed $compress = false)
Sends all headers prior to returning the string
Parameters
  • bool $compress If true, compress the data
Returns
  • string
Since
  • 3.2

Method toString - Source code

/**
 * Sends all headers prior to returning the string
 *
 * @param   boolean  $compress  If true, compress the data
 *
 * @return  string
 *
 * @since   3.2
 */
public function toString($compress = false)
{
    // Don't compress something if the server is going to do it anyway. Waste of time.
    if ($compress && !ini_get('zlib.output_compression') && ini_get('output_handler') !== 'ob_gzhandler') {
        $this->compress();
    }
    if ($this->allowCache() === false) {
        $this->setHeader('Cache-Control', 'no-cache', false);
    }
    $this->sendHeaders();
    return $this->getBody();
}