Mojolicious::Plugin::Recaptcha - ReCaptcha plugin for Mojolicious framework
0.64
# Mojolicious::Lite plugin recaptcha => { public_key => '...', private_key => '...', lang => 'ru' }; # Mojolicious $self->plugin(recaptcha => { public_key => '...', private_key => '...', lang => 'ru', ssl => 1, # uses https Google URLs }); # template <form action="" method="post"> <%= recaptcha_html %> <input type="submit" value="submit" name="submit" /> </form> # set reCaptcha widget language from template <form action="" method="post"> <%= recaptcha_html 'ru' %> <input type="submit" value="submit" name="submit" /> </form> # checking blocking way $self->recaptcha; unless ($self->stash('recaptcha_error')) { # all ok } # checking non-blocking way $self->render_later; $self->recaptcha(sub { my $ok = shift; if ($ok) { } else { warn $self->stash('recaptcha_error'); } # here you need call render $self->render; })
English by default (en)
Dutch (nl)
French (fr)
German (de)
Portuguese (pt)
Russian (ru)
Spanish (es)
Turkish (tr)
Plugin support all recaptcha options: https://developers.google.com/recaptcha/docs/customization
Repository
http://github.com/konstantinov/Mojolicious-Plugin-Recaptcha
Mojolicious, Mojolicious::Plugin, Mojolicious::Lite
Special thanks for help in development
Alexander Voronov
Tim Wilde
Sangre
Fayland Lam
BERENYI Mihaly
Copyright 2010-2016 Dmitry Konstantinov. All right reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Mojolicious::Plugin::Recaptcha, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::Recaptcha
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::Recaptcha
For more information on module installation, please visit the detailed CPAN module installation guide.