[Catalyst] displaying csv content

Jonathan Rockway jon at jrock.us
Fri Feb 23 17:35:24 GMT 2007


Octavian Rasnita wrote:
> I think there should be a more elegant solution.

You should probably have a CSV view which sets the headers properly.
Forward to the CSV view for CSV, or the HTML view for HTML.

In one of my applications, I have YAML, JSON, HTML, and Atom as possible
output formats.  My controller code is the same for each of the formats;
the View is where I do the view-specific work.  (That's the idea behind
MVC, after all.)

Regards,
Jonathan Rockway

-- 
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;



More information about the Catalyst mailing list