Group
Extension

Matches 2

Data-FormValidator-Multi ( T/TR/TRWWW/Data-FormValidator-Multi-0.002.tar.gz, TRWWW, 2021; MetaCPAN )
Data-FormValidator-Multi/lib/Data/FormValidator/Multi.pm ( view source; MetaCPAN )
 );
    
    # call ->to_json on the results object to get a data structure of errors
    use Data::Dumper;
    print Data::Dumper->Dump([$results->to_json], ['results_as_json']);

=head1 DESCRIPTION
ss()> will return false if a
single bit of data in the data structure is invalid. From there C<to_json()> can
be called on the C<$result> to get a data structure that has invalid fields as
keys and th
    
    use Data::Dumper;
    print Data::Dumper->Dump([$results->to_json], ['results_as_json']);

outputs:

    $results_as_json = {
                     'meta' => {
                                
Data-FormValidator-Multi ( T/TR/TRWWW/Data-FormValidator-Multi-0.002.tar.gz, TRWWW, 2021; MetaCPAN )
Data-FormValidator-Multi/lib/Data/FormValidator/Multi/Results.pm ( view source; MetaCPAN )
lts = $dfv->check( $data );
    
    if ( ! $results->success ) {
      $c->stash->{json}{errors} = $results->to_json;
      return;
    }

    # handle valid data

=head1 DESCRIPTION

Results of the 
eturn $self->has_objects ? undef : $self->SUPER::success;
  }
}

=head2 to_json

If this is an array of results, call to_json on each element and return an array
of the results. Otherwise, return a da
t

sub to_json {
  my $self = shift;

  my $json = [];

  if ( $self->isa('ARRAY') ) {
    foreach my $results ( @$self ) {
      push @$json => $results->to_json;
    }
  } else {
    $json = $self->

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.