Hi!

You need to extend from TimeHelper, not from Helper.

MyTimeHelper extends TimeHelper {}

Then you have to add it to your $helpers array.

$helpers = array('Time', 'MyTime');


On Sun, Jul 20, 2008 at 2:42 AM, . <[EMAIL PROTECTED]> wrote:
> Hi
>
> I would like to add some custom functions to the TimeHelper. How would I do
> this?
>
> Can I just add a views/helpers/timehelper.ctp file and
>
> <?php
>
> class TimeHelper extends Helper
> {
>
>     function custom($time)
>     {
>         echo $this->nice($time);
>     }
> }
>
> ?>
>
> However, I cannot use the nice() function in the original timehelper class.
> how do i do this?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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