line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::DataTables::SSP::Results; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
13
|
use Mojo::Base -base; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
12
|
|
4
|
2
|
|
|
2
|
|
249
|
use Mojo::JSON qw(encode_json); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
269
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.02'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has 'draw'; |
9
|
|
|
|
|
|
|
has 'records_total'; |
10
|
|
|
|
|
|
|
has 'records_filtered'; |
11
|
|
|
|
|
|
|
has 'data'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub TO_JSON { |
14
|
|
|
|
|
|
|
|
15
|
0
|
|
|
0
|
1
|
|
my ($self) = @_; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
return { |
18
|
0
|
|
|
|
|
|
draw => $self->draw, |
19
|
|
|
|
|
|
|
recordsTotal => $self->records_total, |
20
|
|
|
|
|
|
|
recordsFiltered => $self->records_filtered, |
21
|
|
|
|
|
|
|
data => $self->data, |
22
|
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=encoding utf8 |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 NAME |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Mojolicious::Plugin::DataTables::SSP::Results - DataTables SSP Result Helper |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 SYNOPSIS |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# Mojolicious |
37
|
|
|
|
|
|
|
$self->plugin('DataTables'); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# Mojolicious::Lite |
40
|
|
|
|
|
|
|
plugin 'DataTables'; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
[...] |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
$c->render(json => $c->datatable->ssp_results( |
45
|
|
|
|
|
|
|
draw => 1, |
46
|
|
|
|
|
|
|
data => \@results, |
47
|
|
|
|
|
|
|
records_total => 100, |
48
|
|
|
|
|
|
|
records_filtered => 0 |
49
|
|
|
|
|
|
|
)); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 DESCRIPTION |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
L is a L plugin to add DataTables SSP (Server-Side Protocol) support in your Mojolicious application. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 METHODS |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
L implements the following methods. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 draw |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 records_total |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 records_filtered |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 data |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head2 TO_JSON |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 SEE ALSO |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
L, L, L, L, L. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |