FormValidator-Simpleのプラグインを作る

 package MyFVS;
 
 use strict;
 use warnings;
 use FormValidator::Simple::Constants;
 
 sub MY_VALIDATION {
    my ($self, $params, $args) = @_;
    my ($year, $month, $day) = ($params->[0], $params->[1], $params->[2]);
    my ($foo, $bar) = ($args->[0], $args->[1]);
    return TRUE;
 }
 
 1;
 my $result = FormValidator::Simple->check(
    $q => [
        { my_date => ['year','month','day'] } => [ ['MY_VALIDATION', 'foo', 'bar'] ]
    ]
 );

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS