これは私のZendへの最初の旅行で、安らかなAPIを設定する作業に直面しています。私は、そのコード例えば、次のようになりZendの残りのコントローラを使用: -Zend RestクライアントでZend Restコントローラを使用する
myzendrestcontroller-"localhost/alice/Theb2cController.php"
<?php
class Theb2cController extends Zend_Rest_Controller
{
public function init() {
$this->_helper->viewRenderer->setNoRender(true);
}
public function indexAction() {
$this->getResponse()
->appendBody($xml);
}
public function getAction() {
if ($this->getRequest()->getParam ("name") != NULL) {
$return =" wow";
} else {
$return= 'no parameters!';
}
echo $return
}
public function postAction() {
$salutation=$this->getRequest()->getParam("salutation");
}
public function putAction() {
}
public function deleteAction() {
$this->getResponse()
->appendBody("From deleteAction() deleting the requested article");
}
}
?>
クライアントは、次のようになります -
myzendclient-"localhost/alice1/theb2cclient.php"
require_once("Zend/Rest/Client.php");
$url="localhost/alice/Theb2cController.php"
$client1=new Zend_Rest_Client($url);
$client1->name('alice');
$response=$client1->get();
echo $response;
しかし、私は任意の応答を取得いけない、それだけで空白の画面です。誰か助けてもらえますか
プロジェクトのスタンドアロンオブジェクトとして、ZendのMVCフレームワーク全体またはZend_Restクラスのみを使用していますか? –
@Adrian私は安静なWebサービスプロジェクトを実行すると、Zend Restクラス – Rasmus