Commit | Line | Data |
5ee249f2 |
1 | package Catalyst::View; |
2 | |
6f1f968a |
3 | use MRO::Compat; |
4 | use mro 'c3'; |
e5ecd5bc |
5 | use Moose; |
6 | extends qw/Catalyst::Component/; |
5ee249f2 |
7 | |
8 | =head1 NAME |
9 | |
10 | Catalyst::View - Catalyst View base class |
11 | |
12 | =head1 SYNOPSIS |
13 | |
76ddf86b |
14 | package Catalyst::View::Homebrew; |
15 | |
16 | use base qw/Catalyst::View/; |
17 | |
18 | sub process { |
19 | # template processing goes here. |
20 | } |
5ee249f2 |
21 | |
22 | =head1 DESCRIPTION |
23 | |
ac5c933b |
24 | This is the Catalyst View base class. It's meant to be used as |
76ddf86b |
25 | a base class by Catalyst views. |
26 | |
ac5c933b |
27 | As a convention, views are expected to read template names from |
76ddf86b |
28 | $c->stash->{template}, and put the output into $c->res->body. |
29 | Some views default to render a template named after the dispatched |
30 | action's private name. (See L<Catalyst::Action>.) |
31 | |
ac5c933b |
32 | =head1 METHODS |
76ddf86b |
33 | |
34 | Implements the same methods as other Catalyst components, see |
35 | L<Catalyst::Component> |
5ee249f2 |
36 | |
a8dc76a1 |
37 | =head2 process |
38 | |
39 | gives an error message about direct use. |
40 | |
41 | =cut |
42 | |
43 | sub process { |
44 | |
45 | Catalyst::Exception->throw( message => ( ref $_[0] || $_[0] ). |
46 | " directly inherits from Catalyst::View. You need to\n". |
47 | " inherit from a subclass like Catalyst::View::TT instead.\n" ); |
48 | |
49 | } |
50 | |
51 | =head2 $c->merge_hash_config( $hashref, $hashref ) |
52 | |
53 | Merges two hashes together recursively, giving right-hand precedence. |
54 | |
55 | =cut |
56 | |
5ee249f2 |
57 | =head1 AUTHOR |
58 | |
59 | Sebastian Riedel, C<sri@oook.de> |
76ddf86b |
60 | Marcus Ramberg, C<mramberg@cpan.org> |
5ee249f2 |
61 | |
62 | =head1 COPYRIGHT |
63 | |
64 | This program is free software, you can redistribute it and/or modify it under |
65 | the same terms as Perl itself. |
66 | |
67 | =cut |
68 | |
6680c772 |
69 | no Moose; |
0fc2d522 |
70 | #__PACKAGE__->meta->make_immutable(); |
6680c772 |
71 | |
5ee249f2 |
72 | 1; |