package LIMS::Controller::Roles::FormData;

use Moose::Role;

use Data::FormValidator;

sub get_data_from_dfv {
    my $self = shift;
    my $profile = shift
        || return $self->error('no profile passed to get_data_from_dfv()');
    
    my $dfv = Data::FormValidator->check($self->query, $profile);
    my $data = $dfv->valid(); # $self->debug($data);
    
    return $data;
}

1;
