t/lib/Form/Test.pm
raw| 1 | package Form::Test; |
| 2 | |
| 3 | use HTML::FormHandler::Moose; |
| 4 | extends 'HTML::FormHandler'; |
| 5 | |
| 6 | has '+name' => ( default => 'TestForm'); |
| 7 | |
| 8 | has_field 'reqname' => ( type => 'Text', required => 1 ); |
| 9 | has_field 'optname' => ( type => 'Text' ); |
| 10 | has_field 'fruit' => ( type => 'Select' ); |
| 11 | |
| 12 | |
| 13 | sub options_fruit { |
| 14 | return ( |
| 15 | 1 => 'apples', |
| 16 | 2 => 'oranges', |
| 17 | 3 => 'kiwi', |
| 18 | ); |
| 19 | } |
| 20 | |
| 21 | no HTML::FormHandler::Moose; |
| 22 | 1; |
| 23 |