コード例 #1
0
ファイル: Http.php プロジェクト: bradley-holt/zf2
 /**
  * Override __toString() to send HTTP Content-Type header
  *
  * @return string
  */
 public function __toString()
 {
     if (!headers_sent()) {
         header('Content-Type: text/xml; charset=' . strtolower($this->getEncoding()));
     }
     return parent::__toString();
 }
コード例 #2
0
ファイル: ResponseTest.php プロジェクト: pnaq57/zf2demo
 /**
  * __toString() test
  */
 public function test__toString()
 {
     $this->_response->setReturnValue('return value');
     $xml = $this->_response->__toString();
     $this->_testXmlResponse($xml);
 }