File Coverage

blib/lib/Catalyst/View/TT/XHTML.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             package Catalyst::View::TT::XHTML;
2              
3 1     1   1464 use Moose;
  0            
  0            
4             use namespace::clean -except => 'meta';
5              
6             extends qw/Catalyst::View::TT/;
7             with qw/Catalyst::View::ContentNegotiation::XHTML/;
8              
9             our $VERSION = '1.103';
10              
11             1;
12              
13             __END__
14              
15             =head1 NAME
16              
17             Catalyst::View::TT::XHTML - A sub-class of the standard TT view which serves
18             application/xhtml+xml content if the browser accepts it.
19              
20             =head1 SYNOPSIS
21              
22             package MyApp::View::XHTML;
23             use strict;
24             use warnings;
25             use base qw/Catalyst::View::TT::XHTML/;
26              
27             1;
28              
29             =head1 DESCRIPTION
30              
31             This is a very simple sub-class of L<Catalyst::View::TT>, which sets the
32             response C<Content-Type> to be C<application/xhtml+xml> if the user's browser
33             sends an C<Accept> header indicating that it is willing to process that MIME
34             type.
35              
36             Changing the C<Content-Type> causes browsers to interpret the page as XML,
37             meaning that the markup must be well formed.
38              
39             This is useful when you're developing your application, as you know that all
40             pages you view are parsed as XML, so any errors caused by your markup not
41             being well-formed will show up at once.
42              
43             =head1 NOTE
44              
45             This module is a very simple demonstration of a consumer of the
46             L<Catalyst::View::ContentNegotiation::XHTML> role.
47              
48             If your needs are not trivial, or you are not using TT, then using this view
49             is B<discouraged and deprecated>. It is highly recommended that you consume
50             the L<Catalyst::View::ContentNegotiation::XHTML> role yourself, rather than
51             doing silly things with multiple inheritance to use this view in combination
52             with another one.
53              
54             =head1 AUTHOR
55              
56             Original author and maintainer - Tomas Doran (t0m)
57             C<< <bobtfish@bobtfish.net> >>
58              
59             Now mostly the work of other, smarter people - see
60             L<Catalyst::View::ContentNegotiation::XHTML>.
61              
62             =head1 COPYRIGHT
63              
64             This module itself is copyright (c) 2008 Tomas Doran and is licensed under the
65             same terms as Perl itself.
66              
67             =cut