Amon2-Plugin-Web-FormValidator-Simple

 view release on metacpan or  search on metacpan

lib/Amon2/Plugin/Web/FormValidator/Simple.pm  view on Meta::CPAN

package Amon2::Plugin::Web::FormValidator::Simple;
use utf8;
use strict;
use warnings;
use 5.008001;
our $VERSION = '0.04';

use FormValidator::Simple;

sub init { my ($class, $c, $conf) = @_; #{{{
    my $s = $c->config->{validator};

t/01_validate.t  view on Meta::CPAN

use utf8;
use strict;
use warnings;
use Test::More;
use Test::Requires 'Test::WWW::Mechanize::PSGI';

use Encode;
use Plack::Middleware::Lint;
use Text::Xslate;

my $conf = +{ # app config {{{

t/01_validate.t  view on Meta::CPAN

sub n {
    local $_ = shift;
    s/\n$//;
    $_;
}

sub query_string {
    my %param = ref $_[0] ? %{$_[0]} : @_;
    my $str = '';
    while (my ($k, $v) = each %param) {
        $v = encode(utf8 => $v);
        $v =~ s/([^a-zA-Z0-9_.!~*'()-])/'%' . unpack('H2', $1)/eg;
        $str .= "&$k=$v";
    }
    $str =~ s/^&//;

    return $str;
}
#}}}



( run in 1.066 second using v1.01-cache-2.11-cpan-49f99fa48dc )