Monday, May 31, 2010

Re: helper naming convention

you must have made an error
because miles' version does work and yours is not really the way to go

if you want to name it timeline.php (all lowercase), its supposed to
be:

Class: TimelineHelper
File:timeline.php
include: $helpers=array('Timeline');


On 31 Mai, 06:00, Bryan Lim <ytbr...@gmail.com> wrote:
> Hi all,
>
> I used what Miles suggested. But don't work. Right now, I am using
> this:
>
> Class: TimeLineHelper
> File:timeline.php
> include: $helpers=array('timeline');
>
> which is working fine.
>
> am still curious why the suggested namiing don't work ?
>
> /b
>
> On May 31, 4:46 am, Miles J <mileswjohn...@gmail.com> wrote:
>
>
>
> > Yeah Cakes naming conventions can be confusing:
>
> > Class: TimeLineHelper
> > File: time_line.php
> > Include: $helpers = array('TimeLine')
>
> > On May 29, 8:03 pm, Steve Love <stevel...@gmail.com> wrote:
>
> > > The error message gives you a subtle hint.
> > > With a file named time_line.php, try defining it in the controller as:
> > > var $helpers = array('TimeLine');
>
> > > Steve
>
> > > On May 29, 8:58 pm, Bryan Lim <ytbr...@gmail.com> wrote:
>
> > > > Hi all,
>
> > > > Can someone please tell me what did I do wrong with the naming
> > > > convention?
>
> > > > I named myhelpertime_line.php. It is called class TimeLineHelper
> > > > extends AppHelper.
>
> > > > At the controller, var $helpers = array("time_line");
>
> > > > But it gives me error that TimeLineHelper is not found.
>
> > > > So I change time_line.php to tl.php. TimeLineHelper to TlHelper.
> > > > $helpers = array("tl");
>
> > > > it works.
>
> > > > I am using cakephp 1.3.
>
> > > > Thanks!
> > > > Bryan

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: