Changeset 12908 for lang/perl/FormValidator-LazyWay
- Timestamp:
- 05/31/08 16:17:11 (5 years ago)
- Location:
- lang/perl/FormValidator-LazyWay/trunk
- Files:
-
- 2 modified
-
lib/FormValidator/LazyWay.pm (modified) (2 diffs)
-
t/rule-string.t (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/FormValidator-LazyWay/trunk/lib/FormValidator/LazyWay.pm
r11384 r12908 30 30 31 31 return $self; 32 }33 # TODO load時に全部作成して持たした方がいいかなぁ。増えると重たくなるなぁ。34 # その作りにすると、オプションで、message機能を使用するか、しないか選べるとか、必要な言語を指定できるとかは最低限いるよな。35 # これ動かない。36 sub get_message {37 my $self = shift;38 my $field = shift;39 40 my $label = shift;41 my $type = shift || 'strict';42 my $lang = shift || $self->{config}{default}{language} ;43 my $message = $self->{messages}{ $label }{ $lang } ;44 my $args = $self->{args}{$type}{$field}{$label} || {};45 46 foreach my $key ( keys %{ $args } ) {47 my $regexp = '\$_\[' . $key . '\]' ;48 my $value = $args->{$key};49 $message =~ s/$regexp/$value/g;50 }51 52 return $message;53 32 } 54 33 … … 468 447 =head2 new 469 448 470 =head2 get_message471 472 449 =head2 constraints 473 450 -
lang/perl/FormValidator-LazyWay/trunk/t/rule-string.t
r10229 r12908 14 14 15 15 my $config = LoadFile( $conf_file ); 16 my $dfv = FormValidator::LazyWay->new( $config );16 my $dfv = FormValidator::LazyWay->new( $config ); 17 17 18 18
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)