526bca6ae4742848861475fa35e17fd99aa5004f
[catagits/Catalyst-View-ContentNegotiation-XHTML.git] / lib / Catalyst / View / TT / XHTML.pm
1 package Catalyst::View::TT::XHTML;
2
3 use Moose;
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.100';
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
18 serves 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
32 the response C<Content-Type> to be C<application/xhtml+xml> if the
33 user's browser sends an C<Accept> header indicating that it is willing
34 to process that MIME type.
35
36 Changing the C<Content-Type> causes browsers to interpret the page as
37 XML, meaning that the markup must be well formed.
38
39 This is useful when you're developing your application, as you know that
40 all pages you view are parsed as XML, so any errors caused by your markup
41 not 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, then it is recommended that you consume
49 that role yourself.
50
51 =head1 AUTHOR
52
53 Tomas Doran (t0m) C<< <bobtfish@bobtfish.net> >>
54
55 =head1 COPYRIGHT
56
57 This module itself is copyright (c) 2008 Tomas Doran and is licensed under the same terms as Perl itself.
58
59 =cut