Felix started off by baking his application. While baking his controller he added in the Javascript Helper and RequestHandler Component. This will save adding them in later. Because the demo was based on Jquery the Ajax helper could not be used. However, Felix raised a very good issue of using a helper vs. writing Javascript. His opinion is that if you want to build a heavy AJAX application you should write all your javascript. If you just need a bit of AJAX sprinkled on you can use the helper. However, helpers are difficult to use in wide applications as they abstract one language into another which is tricky.
Felix talked briefly about how he organizes his javascript. He likes to have specific javascript files for each controller/view placed in js/views as well as a few utility libraries. This allows his projects to reuse general js code as well as keep the Javascript separate for each view.
Adding jquery.form
Felix recommends using the form jquery plugin for working with forms. It allows you to easily add ajax behavior to your forms. After adding jquery.forms to the layout and creating his view js file. He was able to quickly make his form Ajax-ified. A question was asked about using JSON with Ajax in CakePHP. Felix then demonstrated how you could create a JSON Ajax view. By adding Router::parseExtensions('json');
Felix then created his json layout and his json view. Extension based views need to go into a directory that shares the name with the extension. By adding a 2nd and 4th parameter to $.get() you can force a json return.
$.get('/cakefest/view/2.json', {}, function(response, status){
//handle response here
}, 'json');
Is an example of how to do this. A question about pagination was asked. Felix's solution was to use a selector and attach an event to all your pagination buttons.
This concludes CakeFest Argentina. I had a really great time and would like to thank everyone who came out, and everyone who presented. I would also like to thank all of our sponsors, SaniSoft, Zeadoo, WidgetPress and the CakeDC. Lastly, thanks to Mariano and Claudio for orgnanizing and hosting the event.