]> Dogcows Code - chaz/chatty/blob - lib/Chatty/Form/Register.pm
switch to FormHandler for validation
[chaz/chatty] / lib / Chatty / Form / Register.pm
1 package Chatty::Form::Register;
2
3 use HTML::FormHandler::Moose;
4 extends 'HTML::FormHandler::Model::DBIC';
5
6 has '+item_class' => (default => 'Account');
7
8 has_field 'email' => (type => 'Email', label => 'Email address');
9 has_field 'username' => (label => 'User Nickname', required => 1, unique => 1);
10 has_field 'password' => (type => 'Password', required => 1);
11 has_field 'password_confirm' => (type => 'PasswordConf', required => 1);
12 has_field 'submit' => (type => 'Submit', value => 'Register');
13
14 has '+unique_messages' => (default => sub {
15 {username => 'Username is already registered'};
16 });
17
18 no HTML::FormHandler::Moose;
19 __PACKAGE__->meta->make_immutable;
20 1;
This page took 0.033238 seconds and 4 git commands to generate.