Guest User

Untitled

a guest
Mar 16th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. package Joe::Registration::Form;
  2.  
  3. use HTML::FormHandler::Moose;
  4. extends 'HTML::FormHandler';
  5.  
  6. has '+item_class' => ( default => 'Registration' );
  7.  
  8. has_field username => (
  9. type => 'Username',
  10. label => 'Username',
  11. required => 1,
  12. );
  13.  
  14. has_field email => (
  15. type => 'Email',
  16. label => 'Email Address',
  17. required => 1,
  18. );
  19.  
  20. has_field password => (
  21. type => 'Password',
  22. label => 'Password',
  23. required => 1,
  24. );
  25.  
  26. subtype 'Username'
  27. => as 'Str'
  28. => where {$_ =~ /[\d\w]{1,16}/}
  29. => message { "Can only contain letters and numbers" };
  30.  
  31. no HTML::FormHandler::Moose;
Add Comment
Please, Sign In to add comment