HTML :: FormHandler sort_column for HTML :: FormHandler :: Field :: Select

时间:2014-07-16 01:26:09

标签: perl html-formhandler

HTML::FormHandler::Select的文档说sort_column选项Sets or returns the column or arrayref of columns used in the foreign class for sorting the options labels.我尝试过设置它,但它没有设置我的选项:

has_field 'my_field' => ( 
    type => 'Select',
    sort_column => 'label',
    required => 1,
);

我还尝试不设置sort_column,因为默认情况下是按标签栏排序,这是我想要的,但它似乎仍然无法正常工作。有谁知道如何HTML::FormHandler对我的选择字段的值进行排序?目前,使用选项功能设置值:

sub options_my_field { 
    return [
        {
            value => 1,
            label => 'One',
        },
        {
            value => 2,
            label => 'Two',
        },
    ];
}

0 个答案:

没有答案
相关问题