views:

94

answers:

2

Hello,

I'm just starting using cakePHP and I saw on that there was an AJAX Helper in it.

My question is simple : should I rather use this helper or should I keep doing AJAX with jQuery? Are there any changes I should perform in existing jQuery AJAX calls?

Thanks

+2  A: 

You're not supposed to exclusively choose to use one or the other - you're supposed to use both together.

You use jQuery/JavaScript to create and send Ajax requests from your views, as seen in your users' Web browsers, to the server containing your CakePHP application. On the server side, CakePHP's Ajax helper provides your controllers with functionality to work with the data sent with those Ajax requests.

BoltClock
+6  A: 

I don't use the helper at all. Not in Rails, not in CakePHP. I've never cared much for server-side technologies writing my client-side code. I'd much rather include the libraries (I do use Cake's HTML helper for this) and write the javascript/jQuery code myself. Maybe I'm a control freak, but I feel like it gives me a better handle on what's going on under the hood.

Rob Wilkerson
+1 These code generating helpers often do just enough to make a demo work, but usually not enough to be useful for what you actually want to do. And if you're using jQuery anyway, it's just as simple to write the code yourself.
deceze
I uses a modified ajax helper that allows me to use the cake ajax calls with jQuery. It's fantastic!
cdburgess