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