0

I am just new to cakephp 3 and have the following issue: I am calling data from a soap source like this:

//connection to client...
$params = array('iban' => $iban);
$result = $this->client->validateIban($params);

So far so good. I can debug the result too:

debug($result->validateIban);

it returns either 'true' or 'false'.

Now I want to return the value like this:

return $result->validateIban;

But I get now the error:

Controller action can only return an instance of Response

I am now a bit lost as I don't know how to return the value? Can anyone help me out, please?

2
  • Where do you want to return the value? Commented Jan 12, 2016 at 12:32
  • Within a crontroller. I am also doing a jquery.post() to get the data to manipulate the view. Commented Jan 12, 2016 at 12:40

1 Answer 1

1

I think I found the right way: As I am sending with jquery a post to the controller I need to send the value back as json:

$this->response->body(json_encode(array('iban' => $result->validateIban)));
return $this->response;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.