Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Zend framework 如何在zend framwork中发布单个参数?_Zend Framework - Fatal编程技术网

Zend framework 如何在zend framwork中发布单个参数?

Zend framework 如何在zend framwork中发布单个参数?,zend-framework,Zend Framework,我有api控制器和它的注销方法 public function logoutAction() { if(!$this->getRequest()->isPost()) { $response= $this->getResponse(); $response->setHttpResponseCode(406); return $this->_helper->json-&

我有api控制器和它的注销方法

 public function logoutAction()
    {
      if(!$this->getRequest()->isPost())
      {
          $response= $this->getResponse();
          $response->setHttpResponseCode(406);
          return $this->_helper->json->sendJson(array('status'=>'false'));
      }
      else
      {
         $data=$this->_request->getParams();

      }
    }
当我用某个值发布id时(假设我们取id=5),那么$data['id']值显示错误的值5id=5,而不是仅5


但是当我发布多个参数的值时,如id=5、name=abc等,则id值显示真值5。我只需要发布一个id。请提供帮助…谢谢

您可以共享视图脚本吗?如何显示$data['id']的值?与您的问题无关-您以两种不同的方式访问请求对象有什么原因吗?我不需要查看,因此我已禁用控制器构造函数中的布局。我已从$data=$this->_request->getParams()中定义了$data['id'];在注销操作的其他部分。我只是回显它的值并退出。共享您有问题的代码是否有意义?上述代码不会显示请求中的值。数据来自何处?您使用了什么方法?我使用Firefox插件RESTeasy或使用api curl发送数据