line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Form::Tiny::Plugin::Base; |
2
|
|
|
|
|
|
|
$Form::Tiny::Plugin::Base::VERSION = '2.21'; |
3
|
44
|
|
|
44
|
|
599
|
use v5.10; |
|
44
|
|
|
|
|
151
|
|
4
|
44
|
|
|
44
|
|
244
|
use strict; |
|
44
|
|
|
|
|
95
|
|
|
44
|
|
|
|
|
1157
|
|
5
|
44
|
|
|
44
|
|
252
|
use warnings; |
|
44
|
|
|
|
|
137
|
|
|
44
|
|
|
|
|
1441
|
|
6
|
|
|
|
|
|
|
|
7
|
44
|
|
|
44
|
|
479
|
use parent 'Form::Tiny::Plugin'; |
|
44
|
|
|
|
|
201
|
|
|
44
|
|
|
|
|
390
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# This plugin is the core of Form::Tiny DSL |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub plugin |
12
|
|
|
|
|
|
|
{ |
13
|
67
|
|
|
67
|
1
|
231
|
my ($self, $caller, $context) = @_; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
return { |
16
|
|
|
|
|
|
|
subs => { |
17
|
|
|
|
|
|
|
form_field => sub { |
18
|
247
|
|
|
247
|
|
87860
|
$$context = $caller->form_meta->add_field(@_); |
19
|
|
|
|
|
|
|
}, |
20
|
|
|
|
|
|
|
form_cleaner => sub { |
21
|
13
|
|
|
13
|
|
1234
|
$$context = undef; |
22
|
13
|
|
|
|
|
66
|
$caller->form_meta->add_hook(cleanup => @_); |
23
|
|
|
|
|
|
|
}, |
24
|
|
|
|
|
|
|
form_hook => sub { |
25
|
11
|
|
|
11
|
|
742
|
$$context = undef; |
26
|
11
|
|
|
|
|
54
|
$caller->form_meta->add_hook(@_); |
27
|
|
|
|
|
|
|
}, |
28
|
|
|
|
|
|
|
field_validator => sub { |
29
|
7
|
|
|
7
|
|
726
|
$caller->form_meta->add_field_validator($self->use_context($context), @_); |
30
|
|
|
|
|
|
|
}, |
31
|
|
|
|
|
|
|
form_message => sub { |
32
|
2
|
|
|
2
|
|
133
|
$$context = undef; |
33
|
2
|
|
|
|
|
10
|
my %params = @_; |
34
|
2
|
|
|
|
|
8
|
for my $key (keys %params) { |
35
|
4
|
|
|
|
|
16
|
$caller->form_meta->add_message($key, $params{$key}); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
}, |
38
|
|
|
|
|
|
|
}, |
39
|
|
|
|
|
|
|
|
40
|
67
|
|
|
|
|
1352
|
roles => ['Form::Tiny::Form'], |
41
|
|
|
|
|
|
|
}; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|