Parent Directory | Revision Log
allow_blessed
1 | package Frey::View::JSON; |
2 | use Moose; |
3 | |
4 | extends 'Frey'; |
5 | with 'Frey::Web'; |
6 | |
7 | =head1 DESCRIPTION |
8 | |
9 | dump perl data as json |
10 | |
11 | =cut |
12 | |
13 | use JSON; |
14 | |
15 | has data => ( |
16 | is => 'rw', |
17 | required => 1, |
18 | ); |
19 | |
20 | sub as_markup { |
21 | my ($self) = @_; |
22 | $self->content_type('application/javascript'); |
23 | JSON->new->allow_nonref(1)->allow_blessed(1)->encode($self->as_data); |
24 | } |
25 | |
26 | 1; |
ViewVC Help | |
Powered by ViewVC 1.1.26 |