line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::FastHelpers::Controller; |
2
|
3
|
|
|
3
|
|
45569
|
use Mojo::Base 'Mojolicious::Controller'; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
18
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
require Mojolicious::Plugin::FastHelpers; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our %FF; # Consider this internal |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub app { |
9
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
10
|
|
|
|
|
|
|
|
11
|
0
|
0
|
|
|
|
0
|
if (@_) { |
12
|
0
|
|
|
|
|
0
|
my $key = join '::', ref $self, $_[0]; |
13
|
0
|
|
0
|
|
|
0
|
bless $self, $FF{$key} ||= Mojolicious::Plugin::FastHelpers::_generate_class_with_helpers($self, $_[0]); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
0
|
$self->SUPER::app(@_); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new { |
20
|
2
|
|
|
2
|
1
|
78653
|
my $self = shift->SUPER::new(@_); |
21
|
|
|
|
|
|
|
|
22
|
2
|
50
|
|
|
|
70
|
if ($self->{app}) { |
23
|
2
|
|
|
|
|
12
|
my $key = join '::', ref $self, $self->{app}; |
24
|
2
|
|
66
|
|
|
18
|
bless $self, $FF{$key} ||= Mojolicious::Plugin::FastHelpers::_generate_class_with_helpers($self, $self->{app}); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
|
|
9
|
return $self; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=encoding utf8 |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 NAME |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Mojolicious::Plugin::FastHelpers::Controller - Base class for fast controllers |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 SYNOPSIS |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
See L. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 DESCRIPTION |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
L is a substitute for |
45
|
|
|
|
|
|
|
L, if you want your controllers to be fast. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 METHODS |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 app |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
$app = $self->app; |
52
|
|
|
|
|
|
|
$self = $self->app(Mojolicious->new); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Overrides L and applies the helpers from the |
55
|
|
|
|
|
|
|
C<$app> as native methods. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 new |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
$self = Mojolicious::Plugin::FastHelpers::Controller->new(app => $app, ...); |
60
|
|
|
|
|
|
|
$self = Mojolicious::Plugin::FastHelpers::Controller->new({app => $app, ...}); |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
See L |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 SEE ALSO |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
L. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |