[eluser]Unknown[/eluser]
I'm just starting to get the hang of this MVC thing but I'm not quite sure how to handle this problem:
I currently have a fairly solid Upload controller which activates the upload_complete view upon a successful upload. What I would like is for this view to output either XML, JSON or just regular HTML dependent on the request.
For starters, I'm not sure how to pass that information through to the controller/view. For example, when using the Twitter API you just change the feed extension as you so desire: feed.xml / feed.json / feed.atom ... How can I have something similar with CodeIgniter?
It doesn't have to be similar...
One thought I had was to create two functions within my Upload class: "do_upload_jsonoutput" and "do_upload_xmloutput" - and then you can submit to either: "
url/path/upload/do_upload_jsonoutput" ... but this seems a bit messy - there must be a better way!
Any help is appreciated.