Hello everyone, how to use this php code in cakephp 3 by passing the variables?
$client = new SoapClient($url,array('cache_wsdl' => WSDL_CACHE_NONE));
'description'=>'achat en ligne',
It should work. I have implemented the SoapClient recently in a project. Have you tried to execute this code?
The main difference or thing I would suggest is to add the right import:
When I run this single code in a php file it works fine, but in a controller under cakephp I get no response.
should I create a controller action template file containing the code?
Should I enter the code in a controller or single action in a template file? I am new to cakephp and I use version 3.8
Thank you for helping me.
That would depend on your project. In my case, since I invoke this kind of code from scheduled shells, I make the calls inside my model.
But I should clarify that you should never put this kind of code in a template file. This is not code suitable for a view.
can you give me some guidelines to adapt the code of the file to my project in cakephp. In fact, this project consists of subscribing to offers and then making payments via the code in the file.
I beg you to guide me. thank you
As far as I know, you could begin by:
- Defining where to put the code. Wich model or controller should be responsible for this behavior
- Then, add the dependency to that class:
- Create a method that does the job
- Put your code in that method
Thank you. I followed all of your instructions and it works but I see that there is no redirect to the payout site. And I see that it is at the level of
the redirection is not done. How can I adapt this redirect code to cakephp?
Thank you for you precious help
thank you I will come back to you