views:

393

answers:

2

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...

+1  A: 

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

App::import('vendor','nusoap');

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:

$nusoap = new Nusoap();

Not sure if this answers your question - if not, please post some code so we can more effectively diagnose the issue. Good luck!

inkedmn
nope, i know how to use third party libs, i have a stack im using on this project. The problem is getting stubborn libs to conform to cake MVC and url routing conventions... I reckon i will need to extend the lib and rewrite/override some of the functions...
bananarepub
A: 

iam also stuck with the same problem dose any one have solution for it .

islam