Lyo Kato > FormValidator-Simple-Plugin-Japanese-0.02 > FormValidator::Simple::Plugin::Japanese

Download:
FormValidator-Simple-Plugin-Japanese-0.02.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.02   Source   Latest Release: FormValidator-Simple-Plugin-Japanese-0.05

NAME ^

FormValidator::Simple::Plugin::Japanese - Japanese specific validation.

SYNOPSIS ^

    use FormValidator::Simple qw/Japanese/;

    my $result = FormValidator::Simple->check( $req => [
        zip       => [ 'NOT_BLANK', 'JZIP' ],
        name      => [ 'NOT_BLANK', [ 'JLENGTH', 5 10 ] ],
        kana_name => [ 'NOT_BLANK', 'KATAKANA', [ 'JLENGTH', 5, 10 ] ],
        email     => [ [ 'EMAIL_JMOBILE', 'IMODE' ] ],
    ] );

DESCRIPTION ^

This modules adds some Japanese specific validation commands to FormValidator::Simple. Most of validation code is borrowed from Sledge::Plugin::Validator::japanese.

( Sledge is a MVC web application framework: http://sl.edge/jp [Japanese] )

VALIDATION COMMANDS ^

HIRAGANA

check if the data is Hiragana or not.

KATAKANA

check if the data is Katakana or not.

JLENGTH

check the length of the data (behaves like 'LENGTH'). but this counts multibyte character as 1.

JZIP

check Japanese zip code. [ seven digit ( and - ) for example 1111111, 111-1111 ]

    my $result = FormValidator::Simple->check( $req => [
        zip => [ 'JZIP' ],
    ] );

or you can validate with two params, [ one is three digit, another is four digit ]

    my $result = FormValidator::Simple->check( $req => [
        { zip => [qw/zip1 zip2/] } => [ 'JZIP' ]
    ] );
EMAIL_JMOBILE

check with Mail::Address::MobileJp.

    my $result = FormValidator::Simple->check( $req => [
        email => [ 'EMAIL_JMOBILE' ]
    ] );

you can also check if it's 'IMODE', 'EZWEB', or 'VODAFONE'.

    my $result = FormValidator::Simple->check( $req => [
        email => [ ['EMAIL_JMOBILE', 'VODAFONE' ] ]
    ] );

SEE ALSO ^

FormValidator::Simple

Mail::Address::MobileJp

Jcode

Unicode::RecursiveDowngrade

http://sl.edge/jp/ (Japanese)

http://sourceforge.jp/projects/sledge

AUTHOR ^

Lyo Kato <lyo.kato@gmail.com>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: