X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FView.pm;h=7ff04509331810c793b70ea8fa945aaa12929c4f;hb=b354201608d428db344c63dd35de096a62a7a9d3;hp=77597a6da2e3077401116622eb8b81b5a99038a7;hpb=5ee249f25d549a71fdb509af9d99151f62cddab8;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/View.pm b/lib/Catalyst/View.pm index 77597a6..7ff0450 100644 --- a/lib/Catalyst/View.pm +++ b/lib/Catalyst/View.pm @@ -1,7 +1,7 @@ package Catalyst::View; -use strict; -use base qw/Catalyst::Component/; +use Moose; +extends qw/Catalyst::Component/; =head1 NAME @@ -9,15 +9,52 @@ Catalyst::View - Catalyst View base class =head1 SYNOPSIS -See L. + package Catalyst::View::Homebrew; + + use base qw/Catalyst::View/; + + sub process { + # template processing goes here. + } =head1 DESCRIPTION -Catalyst View base class. +This is the Catalyst View base class. It's meant to be used as +a base class by Catalyst views. + +As a convention, views are expected to read template names from +$c->stash->{template}, and put the output into $c->res->body. +Some views default to render a template named after the dispatched +action's private name. (See L.) + +=head1 METHODS + +Implements the same methods as other Catalyst components, see +L + +=head2 process + +gives an error message about direct use. + +=cut -=head1 AUTHOR +sub process { -Sebastian Riedel, C + Catalyst::Exception->throw( message => ( ref $_[0] || $_[0] ). + " directly inherits from Catalyst::View. You need to\n". + " inherit from a subclass like Catalyst::View::TT instead.\n" ); + +} + +=head2 $c->merge_hash_config( $hashref, $hashref ) + +Merges two hashes together recursively, giving right-hand precedence. + +=cut + +=head1 AUTHORS + +Catalyst Contributors, see Catalyst.pm =head1 COPYRIGHT @@ -26,4 +63,7 @@ the same terms as Perl itself. =cut +no Moose; +__PACKAGE__->meta->make_immutable(); + 1;