mro compat stuff
[catagits/Catalyst-Runtime.git] / lib / Catalyst / View.pm
CommitLineData
5ee249f2 1package Catalyst::View;
2
6f1f968a 3use MRO::Compat;
4use mro 'c3';
e5ecd5bc 5use Moose;
6extends qw/Catalyst::Component/;
5ee249f2 7
8=head1 NAME
9
10Catalyst::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 24This is the Catalyst View base class. It's meant to be used as
76ddf86b 25a base class by Catalyst views.
26
ac5c933b 27As a convention, views are expected to read template names from
76ddf86b 28$c->stash->{template}, and put the output into $c->res->body.
29Some views default to render a template named after the dispatched
30action's private name. (See L<Catalyst::Action>.)
31
ac5c933b 32=head1 METHODS
76ddf86b 33
34Implements the same methods as other Catalyst components, see
35L<Catalyst::Component>
5ee249f2 36
a8dc76a1 37=head2 process
38
39gives an error message about direct use.
40
41=cut
42
43sub 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
53Merges two hashes together recursively, giving right-hand precedence.
54
55=cut
56
5ee249f2 57=head1 AUTHOR
58
59Sebastian Riedel, C<sri@oook.de>
76ddf86b 60Marcus Ramberg, C<mramberg@cpan.org>
5ee249f2 61
62=head1 COPYRIGHT
63
64This program is free software, you can redistribute it and/or modify it under
65the same terms as Perl itself.
66
67=cut
68
6680c772 69no Moose;
0fc2d522 70#__PACKAGE__->meta->make_immutable();
6680c772 71
5ee249f2 721;