Any example to send request to controller by Ajax layout

Hello.

I’m try, but without success, call a method on controller by ajax request.

I found examples for olders version of cakephp(2.0), but I’m using 3.5^

thanks…

What don’t you understand about it?
What code are you trying, what are the errors?
More details please

Examples for version 3.6

https://sandbox.dereuromark.de/sandbox/ajax-examples

I am guessing you are referring to a GET request.

I recently did a guide in laravel of the basics. I really don’t want to do one for cakephp and yii2 as all are very similar, just return the JSON according to the cake docs.

Here is the guide in laravel, just very basic starter guide only:
https://laracasts.com/discuss/channels/guides/jquery-get-response

Also a POST
https://laracasts.com/discuss/channels/guides/jquery-ajax-post-example

But adapt to cakephp’s reqest style, etc

But there are ton’s of examples on the jquery site.

If using another JS framework, sorry I can’t help as I use normal javascript and jquery.