CakePHP 1.2 and JSON

While working on BartenderDB.com I decided to try to make the ‘data entry’ as ‘fluid’ as possible, meaning … lots and lots and LOTS of AJAX.  Using jQuery of course.

While looking for some nice Cake 1.2 JSON information, I ran across an interesting post on Pagebakers called Using JSON in CakePHP 1.2.  I gave it a quick read (actually, I skimmed it for code snippets and just rolled my own from the ‘general idea’) and it helped out tremendously.  I was up and running with JSON in under 5 minutes.  Great resource, and kudo’s to the poster.

After setting up my JSON Views, I realized that Cake was still in ‘debug’ mode — so I modified my views/layouts/json/default.ctp and simply added a Configure::write(‘debug’,0); to it … and viola, problem solved, all my JSON requests were free of Cake’s added dev/staging information.

Leave a Reply