widget documentation
[catagits/Reaction.git] / lib / Reaction / UI / Widget / Field / Mutable / MatchingPasswords.pm
1 package Reaction::UI::Widget::Field::Mutable::MatchingPasswords;
2
3 use Reaction::UI::WidgetClass;
4 use namespace::clean -except => [ qw(meta) ];
5
6 extends 'Reaction::UI::Widget::Field::Mutable::Password';
7
8 implements fragment check_field {
9   arg 'field_id'   => event_id 'check_value';
10   arg 'field_name' => event_id 'check_value';
11   render 'field'; #piggyback!
12 };
13
14 implements fragment check_label {
15   if (my $label = $_{viewport}->check_label) {
16     arg label => localized $label;
17     render 'label';
18   }
19 };
20
21 __PACKAGE__->meta->make_immutable;
22
23 1;
24
25 __END__;
26
27 =head1 NAME
28
29 Reaction::UI::Widget::Field::Mutable::MatchingPasswords - Require double input of password
30
31 =head1 DESCRIPTION
32
33 This is a subclass of L<Reaction::UI::Widget::Field::Mutable::Password> implementing
34 a second field to repeat the password input.
35
36 =head1 FRAGMENTS
37
38 =head2 widget
39
40 Will render the C<check_field> fragment after the original C<widget> fragment.
41
42 =head2 check_field
43
44 Renders C<field> with C<field_id> and C<field_name> set to the viewport's C<check_value> event.
45
46 =head2 check_label
47
48 Localises the C<label> argument with a value from the viewport's C<check_label> attribute if
49 one is specified and renders the C<label> fragment.
50
51 =head1 LAYOUT SETS
52
53 =head2 base
54
55   share/skin/base/layout/field/mutable/matching_passwords.tt
56
57 =head1 SEE ALSO
58
59 =over 4
60
61 =item * L<Reaction::UI::Widget::Field::Mutable::Password>
62
63 =back
64
65 =head1 AUTHORS
66
67 See L<Reaction::Class> for authors.
68
69 =head1 LICENSE
70
71 See L<Reaction::Class> for the license.
72
73 =cut