| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::DataTables::SSP::Results; |
|
2
|
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
12
|
use Mojo::Base -base; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
11
|
|
|
4
|
2
|
|
|
2
|
|
311
|
use Mojo::JSON qw(encode_json); |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
302
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '2.01'; |
|
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
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 SUPPORT |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 Bugs / Feature Requests |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Please report any bugs or feature requests through the issue tracker |
|
81
|
|
|
|
|
|
|
at L. |
|
82
|
|
|
|
|
|
|
You will be notified automatically of any progress on your issue. |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 Source Code |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
This is open source software. The code repository is available for |
|
87
|
|
|
|
|
|
|
public review and contribution under the terms of the license. |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
L |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
git clone https://github.com/giterlizzi/perl-Mojolicious-Plugin-DataTables.git |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=head1 AUTHOR |
|
95
|
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=over 4 |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item * Giuseppe Di Terlizzi |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=back |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
This software is copyright (c) 2020-2021 by Giuseppe Di Terlizzi. |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
108
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=cut |