Permalink
Browse files

Released 0.05

  • Loading branch information...
1 parent 151282b commit a165b9c61f19e9369c4d7ef9a2b668cf5af1840c typester committed Jul 23, 2006
Showing with 31 additions and 9 deletions.
  1. +3 −0 Changes
  2. +2 −2 META.yml
  3. +9 −6 README
  4. +17 −1 lib/Catalyst/Plugin/FormValidator/Simple/Auto.pm
View
@@ -1,5 +1,8 @@
Revision history for Perl module Catalyst::Plugin::FormValidator::Simple::Auto
+0.05 2006-07-24T01:48:38+09:00
+ - added forward tracking
+
0.04 2006-07-07T11:56:59+09:00
- fixed yaml load error with latest YAML.pm
View
@@ -1,6 +1,6 @@
---
name: Catalyst-Plugin-FormValidator-Simple-Auto
-version: 0.04
+version: 0.05
author:
- 'Daisuke Murase <typester@cpan.org>'
abstract: Smart validation with FormValidator::Simple
@@ -15,7 +15,7 @@ requires:
provides:
Catalyst::Plugin::FormValidator::Simple::Auto:
file: lib/Catalyst/Plugin/FormValidator/Simple/Auto.pm
- version: 0.04
+ version: 0.05
generated_by: Module::Build version 0.2801
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.2.html
View
15 README
@@ -7,29 +7,31 @@ SYNOPSIS
FormValidator::Simple
FormValidator::Simple::Auto
/;
-
- __PACKAGE__->config(
+
+ __PACKAGE__->config(
validator => {
messages => 'messages.yml',
profiles => 'profiles.yml',
# and other FormValidator::Simple config
},
);
+
- # profiles.yml
+ # profiles.yml
action1:
param1:
- NOT_BLANK
- ASCII
- [ 'LENGTH', 4, 10 ]
param2:
- NOT_BLANK
+
- # then your action
+ # then your action
sub action1 : Global {
my ($self, $c) = @_;
-
- # $c->form($profile) already executed!
+
+ # $c->form($profile) already executed!
unless ($c->form->has_error) {
...
}
@@ -44,6 +46,7 @@ DESCRIPTION
EXTENDED METHODS
setup
prepare
+ forward
ORIGINAL IDEA
Daisuke Maki <dmaki@cpan.org>
@@ -6,7 +6,7 @@ use Catalyst::Exception;
use UNIVERSAL::isa;
use YAML;
-our $VERSION = '0.04';
+our $VERSION = '0.05';
=head1 NAME
@@ -105,6 +105,22 @@ sub prepare {
$c
}
+=head2 forward
+
+=cut
+
+sub forward {
+ my $c = shift;
+ my $action = $_[0];
+
+ if ( my $profile = $c->config->{validator}{profiles}{ $action } ) {
+ $c->form(%$profile);
+ }
+
+ local $NEXT::NEXT{ $c, 'forward' };
+ $c->NEXT::forward(@_);
+}
+
=head1 ORIGINAL IDEA
Daisuke Maki <dmaki@cpan.org>

0 comments on commit a165b9c

Please sign in to comment.