On Sat, Feb 21, 2009 at 11:45 AM, ykyuen <[email protected]> wrote:

>
>
> halo,
>
> i try to follow the following the instruction to create a simple .xls file.
> http://bakery.cakephp.org/articles/view/excel-xls-helper
>
> i have created
> 1. \app\views\helpers\xls.php
> 2. \app\views\<model>\excel.ctp (View Template)
> 3. function excel() {} (an empty fucntion in the corresponding controller)
>
> but whenever i try to browse the corresponding url
> there is an error
> "
> Notice (8): Undefined variable: xls [C:\Program Files\Apache Software
> Foundation\Apache2.2\htdocs\<project>\app\views\<model>\excel.ctp, line 3]
>
> Fatal error: Call to a member function setHeader() on a non-object in
> C:\Program Files\Apache Software
> Foundation\Apache2.2\htdocs\<project>\app\views\<model>\excel.ctp on line 3
> "
>
> the line 3 is
> $xls->setHeader('text_'.date('Y_m_d').'.xls');
>
> is there anything i missed?
> thanks very much for your help
>

Did you add the helper to the helpers array in the controller?

- Gonzalo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to