将 zend_rest 的输出转换为 json
我正在使用 Zend_Rest 在 joomla 中开发 REST api。由于 Zend 组件可以解耦,因此我在 joomla 安装中没有使用整个 Zend 框架,而是在创建应用程序时使用 Zend_Loader 和 Zend_Rest。
主要问题是 - 由于要求,我需要服务器以 json 格式吐出的输出数据,而不是该组件吐出的 xml 树。
如果我使用整个框架,根据我收集的信息,contextSwitch 助手将为我完成简单的移植。
那么,我如何将这些输出移植到 Json 中,因为我完全清楚我没有控制器操作,并且我不在 ZF 内进行开发。
我将不胜感激任何有关此事的帮助。谢谢
I am developing a REST api in joomla using Zend_Rest. As Zend components can be decoupled, I am not using the whole Zend framework in my joomla installation but rather the Zend_Loader and the Zend_Rest in creating my application.
The main issue is - due to requirements, I need to have the output data the server spits out in json format as opposed to the xml tree this component spits out.
If i were using the whole framework, from what I gather a contextSwitch helper would have just done the easy porting for me.
So how then do I port these outputs into Json knowing fully well I dont have the Controller Action in place and I am not developing within the ZF.
I will appreciate any help regarding this. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论