Tuesday, January 12, 2016

cakephp 3 - return object data from a function?

Hi,

I am very new to cake 3 and get stuck within the first steps :-)
I am calling a soap api to validate IBAN numbers.

$this->client = $this->soap();
$params = array('iban' => $iban);
$result = $this->client->validateIban($params);

it works fine, I can debug() the results and get the right data.
To work with this data I need to return the result, bit get this error:

return $result->validateIban;

Controller action can only return an instance of Response            


$result->validateIban ist a string like 'true' or 'false'.
What is the right way to return the result?

Thanks so much for help!!

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: