| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Form::Tiny::Plugin::Base; |
|
2
|
|
|
|
|
|
|
$Form::Tiny::Plugin::Base::VERSION = '2.19'; |
|
3
|
43
|
|
|
43
|
|
642
|
use v5.10; |
|
|
43
|
|
|
|
|
164
|
|
|
4
|
43
|
|
|
43
|
|
266
|
use strict; |
|
|
43
|
|
|
|
|
145
|
|
|
|
43
|
|
|
|
|
1195
|
|
|
5
|
43
|
|
|
43
|
|
259
|
use warnings; |
|
|
43
|
|
|
|
|
119
|
|
|
|
43
|
|
|
|
|
1440
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
43
|
|
|
43
|
|
480
|
use parent 'Form::Tiny::Plugin'; |
|
|
43
|
|
|
|
|
230
|
|
|
|
43
|
|
|
|
|
367
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# This plugin is the core of Form::Tiny DSL |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub plugin |
|
12
|
|
|
|
|
|
|
{ |
|
13
|
65
|
|
|
65
|
1
|
224
|
my ($self, $caller, $context) = @_; |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
return { |
|
16
|
|
|
|
|
|
|
subs => { |
|
17
|
|
|
|
|
|
|
form_field => sub { |
|
18
|
244
|
|
|
244
|
|
87569
|
$$context = $caller->form_meta->add_field(@_); |
|
19
|
|
|
|
|
|
|
}, |
|
20
|
|
|
|
|
|
|
form_cleaner => sub { |
|
21
|
13
|
|
|
13
|
|
754
|
$$context = undef; |
|
22
|
13
|
|
|
|
|
65
|
$caller->form_meta->add_hook(cleanup => @_); |
|
23
|
|
|
|
|
|
|
}, |
|
24
|
|
|
|
|
|
|
form_hook => sub { |
|
25
|
11
|
|
|
11
|
|
809
|
$$context = undef; |
|
26
|
11
|
|
|
|
|
48
|
$caller->form_meta->add_hook(@_); |
|
27
|
|
|
|
|
|
|
}, |
|
28
|
|
|
|
|
|
|
field_validator => sub { |
|
29
|
7
|
|
|
7
|
|
753
|
$caller->form_meta->add_field_validator($self->use_context($context), @_); |
|
30
|
|
|
|
|
|
|
}, |
|
31
|
|
|
|
|
|
|
form_message => sub { |
|
32
|
2
|
|
|
2
|
|
135
|
$$context = undef; |
|
33
|
2
|
|
|
|
|
12
|
my %params = @_; |
|
34
|
2
|
|
|
|
|
8
|
for my $key (keys %params) { |
|
35
|
4
|
|
|
|
|
17
|
$caller->form_meta->add_message($key, $params{$key}); |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
}, |
|
38
|
|
|
|
|
|
|
}, |
|
39
|
|
|
|
|
|
|
|
|
40
|
65
|
|
|
|
|
1290
|
roles => ['Form::Tiny::Form'], |
|
41
|
|
|
|
|
|
|
}; |
|
42
|
|
|
|
|
|
|
} |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
|
45
|
|
|
|
|
|
|
|