line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormFu::Role::Element::ProcessOptionsFromModel; |
2
|
|
|
|
|
|
|
|
3
|
68
|
|
|
68
|
|
35654
|
use strict; |
|
68
|
|
|
|
|
108
|
|
|
68
|
|
|
|
|
2757
|
|
4
|
|
|
|
|
|
|
our $VERSION = '2.05'; # VERSION |
5
|
|
|
|
|
|
|
|
6
|
68
|
|
|
68
|
|
253
|
use Moose::Role; |
|
68
|
|
|
|
|
99
|
|
|
68
|
|
|
|
|
387
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub _process_options_from_model { |
9
|
274
|
|
|
274
|
|
307
|
my ($self) = @_; |
10
|
|
|
|
|
|
|
|
11
|
274
|
|
|
|
|
1002
|
my $args = $self->model_config; |
12
|
|
|
|
|
|
|
|
13
|
274
|
50
|
33
|
|
|
1214
|
return if !$args || !keys %$args; |
14
|
|
|
|
|
|
|
|
15
|
0
|
0
|
|
|
|
|
return if @{ $self->options }; |
|
0
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# don't run if {options_from_model} is set and is 0 |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
my $option_flag |
20
|
|
|
|
|
|
|
= exists $args->{options_from_model} |
21
|
|
|
|
|
|
|
? $args->{options_from_model} |
22
|
0
|
0
|
|
|
|
|
: 1; |
23
|
|
|
|
|
|
|
|
24
|
0
|
0
|
|
|
|
|
return if !$option_flag; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
$self->options( |
27
|
|
|
|
|
|
|
[ $self->form->model->options_from_model( $self, $args ) ] ); |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
return; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
33
|
|
|
|
|
|
|
|