You are here

public function Response::__toString in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/http-foundation/Response.php \Symfony\Component\HttpFoundation\Response::__toString()
  2. 8 vendor/symfony/browser-kit/Response.php \Symfony\Component\BrowserKit\Response::__toString()
Same name and namespace in other branches
  1. 8.0 vendor/symfony/browser-kit/Response.php \Symfony\Component\BrowserKit\Response::__toString()

Converts the response object to string containing all headers and the response content.

Return value

string The response with headers and content

File

vendor/symfony/browser-kit/Response.php, line 47

Class

Response
Response object.

Namespace

Symfony\Component\BrowserKit

Code

public function __toString() {
  $headers = '';
  foreach ($this->headers as $name => $value) {
    if (is_string($value)) {
      $headers .= $this
        ->buildHeader($name, $value);
    }
    else {
      foreach ($value as $headerValue) {
        $headers .= $this
          ->buildHeader($name, $headerValue);
      }
    }
  }
  return $headers . "\n" . $this->content;
}