|
Hi John, since it's a view logic, what you need is a helper Find out how to create and use a helper here-> http://book.cakephp.org/view/100/cakephp-core-helpers John R wrote: I have an "activity list" and am saving the creation datetime in the database.In my view, I want to be able to say "5 minutes ago", "2 hours ago" for the time submitted instead of the complete datetime. I wrote the function that takes the datetime, converts it to a timestamp and then performs the calculation for this .... but ..... where do I call it? If I have timeToAge() in app_controller, I can't exactly call timeToAge($datetime) in the view... So - where should I put the function and how can I call it? Any ideas? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~--- |
- Function in view .... John R
- Re: Function in view .... jonknee
- Re: Function in view .... Grant Cox
- Re: Function in view .... Femi Taiwo
