Ark

 view release on metacpan or  search on metacpan

lib/Ark/Form.pm  view on Meta::CPAN

        $self->fillin_params->{ $k } = $p->{ $k };
    }
}

sub x { $_[0] };

sub messages {
    my $self = shift;

    return {
        not_null => '[_1] is required',
        map({ $_ => '[_1] is invalid' } qw/
                int ascii date duplication length regex uint
                http_url
                email_loose
                hiragana jtel jzip katakana
                file_size file_mime
                / ),
        %{ $self->_fields_messages },
    };
}

t/form/lib/T/Form/Login.pm  view on Meta::CPAN

    type        => 'TextField',
    label       => 'Your Username',
    constraints => ['NOT_NULL', 'ASCII'],
);

param password => (
    type        => 'PasswordField',
    label       => 'Your Password',
    constraints => ['NOT_NULL', 'ASCII', ['LENGTH', 6, 255]],
    messages    => {
        not_null => 'password is required',
        ascii    => 'password must be ascii',
        length   => 'password length must be 6-255',
    },
);

sub custom_validation {
    my ($self, $form) = @_;
    return if $form->has_error;

    my $user = models('users')->find(



( run in 0.339 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )