Development Blog With Code Updates : Developercast.com

October 7, 2011

Abou Kone’s Blog: Set up JSON action output in CakePHP 1.3

Filed under: Development — @ 1:45 pm

Abou Kone has a recent post to his blog showing the CakePHP users out there how to set up JSON output for your actions in a few simple steps.

Working on setting up the Rest Plugin for CakePHP helped me realize that i wanted to set up JSON output for some of my actions. This way, if you request for example “www.yourapp.com/app/post/view/1.json” in the url, you will be returned the JSON post data. This excellent tutorial here will help you achieve it.

Changes include updates to configuration for routing, using the RequestHandler component and setting your actions to output the data correctly when the “.json” is detected on the request.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress