Symfony\Component\HttpFoundation\Response::__toString PHP Метод

__toString() публичный Метод

The string representation of the Response is the same as the one that will be sent to the client only if the prepare() method has been called before.
См. также: prepare()
public __toString ( ) : string
Результат string The Response as an HTTP string
    public function __toString()
    {
        return
            sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText)."\r\n".
            $this->headers."\r\n".
            $this->getContent();
    }

Usage Example

Пример #1
0
 public function __toString()
 {
     $this->headers->set('Content-Length', strlen($this->getContent()));
     return parent::__toString();
 }
All Usage Examples Of Symfony\Component\HttpFoundation\Response::__toString