Reformat docs, couple of other misc dinks
[catagits/Catalyst-View-ContentNegotiation-XHTML.git] / lib / Catalyst / View / TT / XHTML.pm
CommitLineData
0f9bcf09 1package Catalyst::View::TT::XHTML;
56f18daf 2
ef56e95c 3use Moose;
4use namespace::clean -except => 'meta';
5
0561a987 6BEGIN { # You can have chain endpoints in your view if you smoked enough crack..
7 extends qw/Catalyst::View::TT/;
8 with qw/Catalyst::View::ContentNegotiation::XHTML/;
9}
ef56e95c 10
11our $VERSION = '1.100';
12
0f9bcf09 131;
14
15__END__
16
17=head1 NAME
18
0561a987 19Catalyst::View::TT::XHTML - A sub-class of the standard TT view which serves
20application/xhtml+xml content if the browser accepts it.
0f9bcf09 21
22=head1 SYNOPSIS
23
24 package MyApp::View::XHTML;
25 use strict;
26 use warnings;
ef56e95c 27 use base qw/Catalyst::View::TT::XHTML/;
56f18daf 28
0f9bcf09 29 1;
56f18daf 30
0f9bcf09 31=head1 DESCRIPTION
32
0561a987 33This is a very simple sub-class of L<Catalyst::View::TT>, which sets the
34response C<Content-Type> to be C<application/xhtml+xml> if the user's browser
35sends an C<Accept> header indicating that it is willing to process that MIME
36type.
0f9bcf09 37
0561a987 38Changing the C<Content-Type> causes browsers to interpret the page as XML,
39meaning that the markup must be well formed.
0f9bcf09 40
0561a987 41This is useful when you're developing your application, as you know that all
42pages you view are parsed as XML, so any errors caused by your markup not
43being well-formed will show up at once.
0f9bcf09 44
ef56e95c 45=head1 NOTE
56f18daf 46
0561a987 47This module is a very simple demonstration of a consumer of the
48L<Catalyst::View::ContentNegotiation::XHTML> role.
0f9bcf09 49
0561a987 50If your needs are not trivial, then it is recommended that you consume that
51role yourself.
0f9bcf09 52
53=head1 AUTHOR
54
0561a987 55Original author and maintainer - Tomas Doran (t0m)
56C<< <bobtfish@bobtfish.net> >>
57
58Now mostly the work of other, smarter people - see
59L<Catalyst::View::ContentNegotiation::XHTML>.
c2ec1d6a 60
0f9bcf09 61=head1 COPYRIGHT
62
0561a987 63This module itself is copyright (c) 2008 Tomas Doran and is licensed under the
64same terms as Perl itself.
0f9bcf09 65
66=cut