NAME

Form::Factory::Feature::Role::Clean - features that clean up control values

VERSION

version 0.009

SYNOPSIS

  package MyApp::Feature::Foo;
our $VERSION = '0.009';


  use Moose;

  with qw(
      Form::Factory::Feature
      Form::Factory::Feature::Role::Clean
  );

  sub clean {
      my $self = shift;

      # Clean up the value, replace it with Foo
      $self->control->{something}->current_value('Foo');
  }

  package Form::Factory::Feature::Foo;
our $VERSION = '0.009';


  sub register_implementation { 'MyApp::Feature::Foo' }

DESCRIPTION

This is for features that run during the clean phase. This runs immediately after the input has been consumed and before it is checked. These features should avoid reporting errors. The intention is for these features to clean up the input automatically before it is checked for errors. This should work with the control values rather than the action attributes directly, since those won't be set yet.

It is possible for the clean method to stop processing by marking the result as invalid, but it is better to do that using Form::Factory::Feature::Role::Clean.

AUTHOR

Andrew Sterling Hanenkamp <hanenkamp@cpan.org>

COPYRIGHT AND LICENSE

Copyright 2009 Qubling Software LLC.

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