无法让 Nusoap 服务器与 cakephp 一起工作
我试图让 nusoap 服务器与 cakephp 一起工作,我假设的问题是代码位于类(控制器)内,并且 nusoap 试图执行“function()”而不是“$this->function()” 。有谁知道这个问题的简单解决方法,我不喜欢修改第 3 方类......
I am trying to get nusoap server working with cakephp, the problem I am assuming is that the code is within a class (controller) and nusoap is trying to execute 'function()' instead of '$this->function()'. Does anybody know of a simple workaround for this, i don't like modifying 3rd party classes...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将第 3 方代码集成到 CakePHP 项目中的最佳方法是作为供应商。我没有使用过 Nusoap,但我们假设代码位于一个名为
nusoap.php
的文件中:将
nusoap.php
放入/app/vendors< /代码>
将以下代码添加到您的控制器中,可能在构造函数中,
我将进一步假设 nusoap 包含一个或多个您需要实例化才能使用的类。现在您已经包含了
nusoap.php
文件,您只需像创建任何其他类一样创建一个实例:不确定这是否能回答您的问题 - 如果没有,请发布一些代码,以便我们可以更多有效诊断问题。祝你好运!
The best way to integrate 3rd party code into a CakePHP project is as a vendor. I've not used Nusoap, but let's assume that the code lives in a single file called
nusoap.php
:Drop
nusoap.php
into/app/vendors
Add the following code to your controller, probably in the constructor
I'm going to further assume that nusoap contains one or more classes that you'd need to instantiate in order to use. Now that you've included the
nusoap.php
file, you just create an instance like you would any other class:Not sure if this answers your question - if not, please post some code so we can more effectively diagnose the issue. Good luck!