0

我使用 Zend Rest Server 类来处理休息服务:

 public function restAction() {
        $service = new Zend_Rest_Server();
        $service->setClass($this->_serviceClassName);
        $service->handle();
    }

Zend_Rest_Server 中的响应头

<myApi generator="zend" version="1.0">

如何将生成器更改为不同的字符串?

谢谢阿曼。

4

1 回答 1

0

好吧,我发现不是那么优雅的解决方案,但它有效:

 $service->returnResponse(TRUE);
 $response = $service->handle();

 header('Content-Type: text/xml');

 // replace generator="zend" with my_app
 echo str_replace('generator="zend"', 'generator="my_app"', $response);
于 2011-09-17T11:34:42.983 回答