Re: AsForm and accessor names

[prev] [thread] [next] [Date index for 2005/01/05]

From: Dave Howorth
Subject: Re: AsForm and accessor names
Date: 12:11 on 05 Jan 2005
Peter Speltz wrote:
> Actually its not  so values can be returned for objects. Its so the _to_***
> methods can be called by yor model classes , period. Your model classes are the
> ones that call these methods within AsForm and if they are not exported, you'll
> get a method not found error.

I agree that they cause errors if they're not exported but that's easy 
to fix. IMHO, if they start with an underscore, they're intended to be 
private. If that's the case they don't need to be methods, they can just 
be functions and changing the calls from, for example:

     return $self->_to_textarea($field, $accessor)

to this:

     return _to_textarea($self, $field, $accessor)

eliminates the method not found problem and allows them to be made more 
nearly private (i.e no need to export them).

Cheers, Dave

AsForm and accessor names
Dave Howorth 15:09 on 21 Dec 2004

Re: AsForm and accessor names
Peter Speltz 21:17 on 30 Dec 2004

Re: AsForm and accessor names
Peter Speltz 22:18 on 30 Dec 2004

Re: AsForm and accessor names
Dave Howorth 12:11 on 05 Jan 2005

Generated at 12:15 on 16 Jan 2005 by mariachi v0.52