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