Re: AsForm and accessor names
[prev]
[thread]
[next]
[Date index for 2005/01/05]
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