[html-formfu] More questions about selects :)

Andreas Marienborg omega at palle.net
Wed Feb 13 08:35:31 GMT 2008


On Feb 13, 2008, at 9:30 AM, Carl Franks wrote:

> On 13/02/2008, Andreas Marienborg <omega at palle.net> wrote:
>>
>> On Feb 12, 2008, at 11:14 AM, Carl Franks wrote:
>>> And it'll also automatically create methods for
>>> empty_first_label_loc() and empty_first_label_xml()
>>>
>>
>> Ahh, the magic is endless :p calling $self->empty_first_label gives  
>> me
>> the translated one if there is one it seems :) I was trying to check
>> for a set one and translate myself, but it just works (tm).
>
> did you mean empty_first_label_loc()?
> empty_first_label() should just output a html-escaped copy of what  
> you put in.
>

afaict the empty_first_label_loc accessor sets empty_first_label to  
the translated string?

It works at least.

>>> The more difficult bit will be searching through _Group.pm for all
>>> uses of empty_first and making sure it's handled properly.
>>>
>>
>> There doesn't seem to be any tests for empty_first either? atleast
>> grepping t/ doesn't show anything.
>
> my bad!
>

Luckily my tests tests all 3 (options, values, value_range). I think  
there was a bug with double
empty first with value_range before (it got added in both value_range  
and values, and value_range called values).

>> I attach a patch here, for review before I commit, just to make sure
>> the code-style is ok, tests are correctly done etc.
>
> The only thing wrong I can see is that you're not explicitly importing
> 'mk_output_accessors' from HTML::FormFu::Attribute.
> For some reason, that seems to work fine on perl 5.8.x (I'm guessing
> it searches @ISA) - but will die on perl 5.10.x
>

aha, I'll add it then, figured it would inherit it, but perhaps not on  
5.10.x :p


> Other than that, though - it looks great.
> Don't worry about style too much. There's a .perltidyrc file in svn
> that I use to periodically clean up all the files.
> Unfortunately, I can't get access to the repository hooks, otherwise
> I'd add a pre-commit hook to enforce The Style ;)
>

hehe, ok. I'll commit it then


- andreas




More information about the HTML-FormFu mailing list