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