| HTML-Widget documentation | Contained in the HTML-Widget distribution. |
HTML::Widget::Constraint::All - All Constraint
my $c = $widget->constraint( 'All', 'foo', 'bar' );
All named fields are required.
Sebastian Riedel, sri@oook.de
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
| HTML-Widget documentation | Contained in the HTML-Widget distribution. |
package HTML::Widget::Constraint::All; use warnings; use strict; use base 'HTML::Widget::Constraint';
sub process { my ( $self, $w, $params ) = @_; my $results = []; for my $name ( @{ $self->names } ) { push @$results, HTML::Widget::Error->new( { name => $name, message => $self->mk_message } ) if $self->not ? ( defined $params->{$name} && length $params->{$name} ) : ( !defined $params->{$name} || !length( $params->{$name} ) ); } return $results; }
1;