Created
December 4, 2009 00:51
-
-
Save leedo/248744 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Joe::Registration::Form; | |
use HTML::FormHandler::Moose; | |
extends 'HTML::FormHandler'; | |
has '+item_class' => ( default => 'Registration' ); | |
has_field username => ( | |
type => 'Username', | |
label => 'Username', | |
required => 1, | |
); | |
has_field email => ( | |
type => 'Email', | |
label => 'Email Address', | |
required => 1, | |
); | |
has_field password => ( | |
type => 'Password', | |
label => 'Password', | |
required => 1, | |
); | |
subtype 'Username' | |
=> as 'Str' | |
=> where {$_ =~ /[\d\w]{1,16}/} | |
=> message { "Can only contain letters and numbers" }; | |
no HTML::FormHandler::Moose; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment