I'm working on updating my Slim API and wanted to add the ability to define the type of response for a route within the routes url. Similar to how Reddit or Rails does it where you can add a .html,.json, or .xml to a route and have that route return the proper formatted data. Below is a Reddit example of one route being able to return a json,xml, or html response by changing the ending to whatever response type.
http://www.reddit.com/r/ObjectiveC.json
Is this something I will have to do manually with middleware parsing every route or does Slim have this built in? Any help would be greatly appreciated.
Thanks