コード例 #1
0
 public function toResponse()
 {
     $response = parent::toResponse();
     $response->setHeader('Content-Type', 'application/xml; charset="utf-8"');
     $response->setEntity(function (StreamInterface $stream) {
         $xml = new XmlStreamWriter(new StreamWrapper($stream));
         $xml->registerNamespace(WebDav::NS_DAV, 'D');
         $xml->startDocument();
         $xml->startElement(WebDav::NS_DAV, 'error');
         $this->toXml($xml);
         $xml->endElement();
         // D:error
         $xml->endDocument();
         $xml->flush();
     });
     return $response;
 }
コード例 #2
0
ファイル: HttpEntityException.php プロジェクト: koolkode/http
 public function toResponse()
 {
     $response = parent::toResponse();
     $response->setEntity($this->entity);
     return $response;
 }
コード例 #3
0
 public function toResponse()
 {
     $response = parent::toResponse();
     $response->setHeader(new AllowHeader($this->allow));
     return $response;
 }