将 zend_rest 的输出转换为 json

发布于 2024-11-30 02:42:40 字数 332 浏览 3 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文