On 5/29/07, Howard Glynn <[EMAIL PROTECTED]> wrote:
>
> Slightly bad karma to reply to one's own post so soon, but after
> continuing to investigate,
> I'd like to provide a solution for the mail archives. I just didn't fully
> understand the route handling up until this point, but the light is starting
> to go on for me. I have subsequently found 2 ways it can be done:
>
> 1) Less agreeable way: change the cake distro libs/router.php around line
> 147, adding:
>
> $this->connect('/csv/:controller/:action/*',
> array('webservices' => 'Csv'));
>
> 2) More agreeable, add to the application app/config/routes.php
>
> $Route->connect('/csv/:controller/:action/*', array('webservices'
> => 'Csv'));
>
> I am well aware that CSV is not a webservice as such but I want the CSV
> output availability to be consistent with the XML approach.
Is your requirement strictly CSV or can it be an actual Excel file? I found
this article recently at bakery.cakephp.org (which I plan on using) to
create an XLS file from database records:
http://bakery.cakephp.org/articles/view/generate-excel-spreadsheets-from-your-database
If it's strictly CSV what you need, then it won't help, but I think what
klonae said is probably the simplest way.
klonae: just wondering, shouldn't the header() calls be made just before the
foreach begins?
- Gonzalo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---